You're quite right. When you use a single dice (twelve sided) the probability of getting any number (1 to 12 inclusive) is just 1/12. When you use two dices of 6 sides each the probability of each number is markedly different.
`Value Probability Combinations
1 0
2 1/36 1:1
3 2/36 1:2, 2:1
4 3/36 1:3, 2:2, 3,1
5 4/36 1:4, 2:3, 3:2, 4:1
6 5/36 1:5, 2:4, 3:3, 4:2, 5:1
7 6/36 1:6, 2:5, 3:4, 4:3, 5:2, 6:1
8 5/36 2:6, 3:5, 4:4, 5:3, 6:2
9 4/36 3:6, 4:5, 5:4, 6:3
10 3/36 4:6, 5:5, 6:4
11 2/36 5:6, 6:5
12 1/36 6:6
`
Of course, if you're not using a truely random or very, very convincing pseudo-random generator you probably won't quite get these probabilities.
Considering that 7 is a bad number to get in Craps, it'd be nicer to use just a 12 sided dice, but then the Casinos would have to rig the game another way to get their money. ;)
It's good to know that for this kind of example rand() is as good as Math::Random.
jarich |
Comment onRe: Re: check my logic & a random number issueSelectorDownloadCode