Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lowWins = 0;
- highWins = 0;
- for i=(1:1:500000)
- lowSum = 0;
- for low_rolls = (1:1:9)
- lowSum = lowSum + randi(4);
- end
- highSum = 0;
- for high_rolls = (1:1:6)
- highSum = highSum + randi(6);
- end
- if lowSum > highSum
- lowWins = lowWins + 1;
- end
- if lowSum < highSum
- highWins = highWins + 1;
- end
- end
- sprintf("Mandy: %f %", lowWins/5000)
- sprintf("Randy: %f %", highWins/5000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement