How does bootstrap sample pick records

bootstrap_sampling

#1

Hello,

While learning about bootstrap sampling I came across the following:

How are the probabilities being generated(0.15 and 0.05) being used to pick numbers between 1-5?


#2

Let look at what happen with your discrete distribution. If you take a sample of 10 with the weight mentioned and replacement , you can make the assumption that over multiple samples the number of elements smaller or equal to 5 will be around .75.
Then you can verify:
mean(replicate(100, sum( sample(10,replace=T, prob=prob1) <= 5)))
and will get about .75
you can have more fun replicating this and building the distribution
Hope this help.
Alain