Two players are interested in having a game of dice. A single dice is rolled until either two consecutive unequal even numbers appears, or alternatively, a 2, followed immediately by 3. For example, a 2-4 pair is two consecutive unequal even numbers but a 2-2 pair is not. We are interested in which event is more likely to occur, a pair of two consecutive unequal even numbers, or a 2-3 pair? The players would like to investigate.
The SAS data set called dice contains the result of 10000 rolls of a dice. Every time we obtain a pair of two consecutive unequal even numbers or a 2-3 the game is restarted.
Example 1 : rolling 4-6-2 counts as a 4-6 but not as a 6-2.
Example 2 : rolling 4-2-3 counts as a 4-2 but not as a 2-3.
Example 3 : rolling 4-2-2-3 counts as two pairs; a 4-2 and a 2-3.
Example 4 : rolling 4-2-4-6 counts as two pairs; a 4-2 and a 4-6.
Using the SAS data set dice, create two new SAS data sets EvenNum and TwoThree, each containing the one variable, NumRolls. The variable NumRolls indicates the number of dice rolls it took since the last restart. Submit code, and appropriate PROC for both EvenNum and TwoThree. Which event appears more likely to occur, a pair of two consecutive unequal even numbers, or a 2-3 pair? Give the probability and the mean numbers of NumRolls for the events.
I may not thoroughly understand your question.
1. Two consecutive unequal even numbers? Simply speaking, which ones are of your interest?
24 42 26 62 46 64
what about 224, etc.?
2. Apparently, the even-pairs are more often than 2-3 pairs. So why to make the comparison?
This question is hard because the inconsistency exists among the rules. If those examples were followed, it is not ideal to compute the likelihood of getting the desired pairs.
Sometimes I just image that two persons are throwing the dice and the result is only counted at the 2nd person. That is,
data wayne.EvenNum wayne.TwoThree;
drop x pre win;
set wayne.dice;
retain pre 0;
win =0 ;
NumRolls+1;
if (mod(x,2)=0) and (mod(pre,2)=0) and (pre ne 0) and (pre ne x) then do;
output wayne.EvenNum;
win=1;
end;
if (x=3) and (pre=2) then do;
output wayne.TwoThree ;
win=1;
end;
if win=1 then do;
pre=0;
NumRolls=0;
end;
else pre=x;
run;
proc means data=wayne.EvenNum;
run;
proc means data=wayne.TwoThree;
run;