Re: [R] Monty Hall simulation

From: Johannes Huesing <>
Date: Sun, 11 May 2008 10:26:19 +0200

cirrus74 <> [Sun, May 11, 2008 at 03:44:46AM CEST]:
> Is it possible to simulate the Monty Hall problem using R? If so, could
> someone please show me how? Thanks for any help rendered.

The kind of simulation, as any thinking about this seeingly paradoxical situation, depends on your mindset.

To my mind,

niter <- 999
prize <- sample(c("car", "car", "goat"), niter, replace=TRUE)

would be a perfect simulation.

Johannes Hüsing               There is something fascinating about science. 
                              One gets such wholesale returns of conjecture  from such a trifling investment of fact.                (Mark Twain, "Life on the Mississippi")

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 11 May 2008 - 08:31:19 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 12 May 2008 - 19:30:37 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive