In: Math
The group of interest contains everything that isn’t the unwanted group. For this example, the spades, clubs, and diamonds would be the group of interest. However, the hearts would not be in the grouping because they do not want a heart in the hand being dealt.
Show using R for i and j
count1=0
#count1 denotes 1 if the card is from the hearts
count2=0
#count2 denotes the no of hearts in a hand
count3=0
#count3 is the samples in fever of i
count4=0
#count3 is the samples in fever of j
for(i in 1:10000)
{
for(j in 1:13)
{
#generating 13 random numbers from uniform(0,1)
x=runif(13)
#let's consider the card is heart if the random number is less than
0.25
#We can do this because both have the same probability(=1/4)
if(x[j]<.25)
{
count1=1
}
if(count1==1) count2=count2+1
count1=0
}
if(count2<1) count3=count3+1
if(count2<=4) count4=count4+1
count2=0
}
cat("probability that a hand doesn't contain a heart is
",count3/10000,"\n")
cat("probability that a hand doesn't contain more than 4 heart is
",count4/10000,"\n")
RESULT:-
probability that a hand doesn't contain a heart is 0.0241
probability that a hand doesn't contain more than 4 heart is
0.7952