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

Randomness
- 11 Problems
- 19 Finishers
- Given n, create n random numbers such that their standard deviation is also n.
- Generating random matrix with given probability mass function
- Roll the Dice!
- Make a random, non-repeating vector.
- Generate a random matrix A of (1,-1)
- Create a random vector of integers with given sum
- Guess the number I'm thinking of (Part 1)
- Fibonacci Decomposition
- Cryptomath: Addition
- Break it up! Break it up!
- Balanced Ternary Numbers: Easy as |, |-, |o
Problem Recent Solvers133
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!