0

I am trying to calculate the probability of guessing 70 or more correct answers on a 100 question test with 4 answer choices (so 25% chance of guessing correctly on each answer) to illustrate that even a "C" student actually does quite well compared with random guessing.

My understanding of R suggests that 1 − pbinom(69,100,0.25) should be the answer, but R outputs "0" I have tried options(digits=20) and the "mpfr" package but have been unsuccessful.

What is the best way to calculate the answer?

Thanks!

  • You keep getting zero because `all.equal(pbinom(69, 100, 0.25), 1)` returns `TRUE`, which means that as far as R can tell, `pbinom(69, 100, 0.25)` is actually 1.0. What this means is that the `1 - pbinom(69, 100, 0.25)` is less than the machine prescision of `1.490116e-08`. Using the question in the previous comment, `pbinom(70, 100, 0.25)` returns `6.115655e-22`, which is definitely less than the machine tolerance. – Benjamin Mar 07 '17 at 22:55
  • Thanks so much! That seems to have worked and clarified! a=pbinom(69,100,0.25,lower.tail = FALSE) with mpfr(a,1024) is perfect! – Ronald Miller Mar 07 '17 at 23:24

0 Answers0