# 8 people draw a number each from 1..10 with replacement.
# What is the probability that the highest number of the eight is "10"?
u <- rvdiscrete(n=8, x=1:10) # 8 iid variables from the discrete uniform 1:10.
Pr(max(u)==10)
# What is the probability that the person with the 3rd smallest number
# has at least "3"?
s <- sort(u) # order distribution
Pr(s[3]>=3)
Run the code above in your browser using DataLab