Kom igångKom igång gratis

Calculating the expected value

What is the expected value of a binomial distribution where 25 coins are flipped, each having a 30% chance of heads?

Den här övningen är en del av kursen

Foundations of Probability in R

Visa kurs

Övningsinstruktioner

  • Calculate this using the exact formula you learned in the lecture: the expected value of the binomial is size * p. Print this result to the screen.
  • Confirm with a simulation of 10,000 draws from the binomial.

Interaktiv övning med praktiskt arbete

Testa den här övningen genom att slutföra den här exempelkoden.

# Calculate the expected value using the exact formula


# Confirm with a simulation using rbinom
Redigera och kör kod