Problem 44288. Throwing Dice - Will You Be Eaten By The Dragon?
You and a dragon have agreed to let dice rolls determine whether it eats you or not.
The dragon will roll a single die, of x sides. You will roll several dice, of y sides each. The total number of sides on your dice add to x.
The dragon will let you go uneaten if your total throw matches or exceeds theirs.
What are your chances of survival?
Solution Stats
Problem Comments
-
10 Comments
Show
7 older comments
Alex
on 17 Apr 2024
Can someone clear up this 2 confusions i have about the problem.
The problem says i roll several dice of y sides.How many is that? so i just put a rand 100 or smth to see how many times i'll roll?
And second is since i know my dice have y sides how can the sum of the sides be x since x is random?
Christian Schröder
on 17 Apr 2024
@Alex You roll x/y dice, each of which has y sides. Each die is rolled once. x is not random; instead, it's supplied to your function as an argument.
Xinyi Xu
on 5 Jan 2025
I was trying to calculate the probabilities of each point and add them up, but when I explained this problem to my son, I suddenly realized that due to symmetry, the problem became very simple.
Solution Comments
Show commentsGroup

Programování - Cody
- 12 Problems
- 466 Finishers
- Find the sum of all the numbers of the input vector
- Maximum value in a matrix
- Make the vector [1 2 3 4 5 6 7 8 9 10]
- Return area of square
- Select every other element of a vector
- Triangle Numbers
- Check if number exists in vector
- Create times-tables
- Determine whether a vector is monotonically increasing
- Roll the Dice!
- Verify Law of Large Numbers
- Solve a System of Linear Equations
Problem Recent Solvers133
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!