All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Probability
A Game of Dice Puzzle (Posted on 2022-11-14) Difficulty: 3 of 5
Aaron offers Berenice to play a game of dice with him. Aaron explains the game to Berenice as follows:

"We each get one die, the highest one wins. If we tie, I win, but since you always lose when you roll a one, if you roll a one you can roll it again. If you get a one the second time you have to keep it."

What is each person's probability of winning? What are the probabilities of winning if Berenice can keep rolling until she gets something besides a one?

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
re: solution --- simulation | Comment 3 of 7 |
(In reply to solution by Charlie)

Part 1:

bwin=0; awin=0;
for trial=1:100000000
  a=randi(6);
  b=randi(6);
  if b==1
     b=randi(6);
  end
  if b>a
    bwin=bwin+1;
  else
    awin=awin+1;
  end
end
fprintf('%8s %7.5f ','a prob =',awin/trial,'b prob =',bwin/trial);
fprintf('\n');

Five runs with 1 million trials each, plus one with 100 million trials:

>> gameOfDice
a prob = 0.51150 b prob = 0.48850 
>> gameOfDice
a prob = 0.51318 b prob = 0.48682 
>> gameOfDice
a prob = 0.51269 b prob = 0.48731 
>> gameOfDice
a prob = 0.51461 b prob = 0.48539 
>> gameOfDice
a prob = 0.51358 b prob = 0.48642 
>> gameOfDice
a prob = 0.51393 b prob = 0.48607 

Part 2:

Repeating the above (5 with one million, 1 with 100 million trials), but with

while b==1

instead of

if b==1

we get:

>> gameOfDice
a prob = 0.50023 b prob = 0.49978 
>> gameOfDice
a prob = 0.49895 b prob = 0.50106 
>> gameOfDice
a prob = 0.50075 b prob = 0.49925 
>> gameOfDice
a prob = 0.50071 b prob = 0.49929 
>> gameOfDice
a prob = 0.49988 b prob = 0.50012 
>> gameOfDice
a prob = 0.50002 b prob = 0.49998 

  Posted by Charlie on 2022-11-14 14:00:50
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (9)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information