1. Learn
  2. /
  3. Courses
  4. /
  5. Probability Puzzles in R

Exercise

Simulate sign errors: constant probabilities

Let us simulate our math problems and sign errors.

Here, we will assume that the math problem has just 3 steps, and each step has the same probability of a sign switch. We will simulate the completion of the problem with:

  • a 0.10 probability of making a sign switch on each step.
  • a 0.45 probability of making a sign switch on each step.

Instructions

100 XP
  • Simulate 10000 iterations of completion of the 3 step math problem, with a 0.10 probability of a sign switch on each step.
  • Estimate the probability of arriving at the correct answer, by finding the proportion of the time that an even number of sign switches were made.
  • Repeat for a 0.45 probability of a sign switch on each step.
  • Estimate the probability of obtaining the correct answer for this second probability.