What is actually going on in R -the statistics behind rbinom(3, 10, 0.75)?

112 Views Asked by At

What is actually going on in R (the statistics behind rbinom(3, 10, 0.75)?
I know the 3 is the number of observations, the 10 is the number of trials and 0.75 is the probability of success).

The first result from running the R code rbinom(3,10,0.75) was 9 ,8 , 9.

The second result was 7, 8 ,7 .

The third result was 9, 6, 6 .

How is R creating the sequence of numbers? I know it is using the binomial distribution. nCx *p^x * (1-p)^(n-x) where p= 0.75, 1-p= 0.25, n=10, what is x?

What is the range of possible values? Thank you

1

There are 1 best solutions below

0
On
set.seed(42)
rbinom(3, 10, 0.75)
#[1] 6 5 8

The number of experiments is 3. Each experiment consists of 10 trials. The probability of success in each trial is 0.75.

In the first experiment (trial # 1 - trial # 10), there are 6 successes.

In the second experiment (trial # 11 - trial # 20), there are 5 successes.

In the third experiment (trial # 21 - trial # 30), there are 8 successes.