शुरू करेंमुफ़्त में शुरू करें

Simulating coin flips

In these exercises, you'll practice using the rbinom() function, which generates random "flips" that are either 1 ("heads") or 0 ("tails").

यह अभ्यास पाठ्यक्रम का हिस्सा है

Foundations of Probability in R

पाठ्यक्रम देखें

अभ्यास निर्देश

  • With one line of code, simulate 10 coin flips, each with a 30% chance of coming up 1 ("heads").
  • What kind of values do you see?

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

# Generate 10 separate random flips with probability .3
कोड संपादित करें और चलाएँ