۱۸۷
if coin2=1 then
out2$ = "H"
else
out2$ = "T"
end if
print out1$; out2$;"
if out1$ = 'H' and out2$ = "H"
count.event=count.event + 1
end if
next i
print:print
probability = count.event / toss
print "the probability of the event HH is "; probability
print:print end
how many times do you want to toss the two coins
?
50
the outcome of tossing two coins 50 times
is as follows...
وتكون النتيجة :
TT
TT
TH
TH HT HT
TH
HT HH
HT
HH HT
TT
TH HT
HH
TH
HH HH TT
HH TT
TH
TH
TT
HT
HH
HH
TT TT
TT HT
HH
TT
HT
TH
HH
TH
TH HH
TT
HH
TT TH HH
HT
HT
HT
HT TT
the probability of the event HH is .26
ج٢ ص١٨٧