Re: [R] Monty Hall simulation

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

cirrus74 <cirrus74_at_hotmail.com> [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 
mailto:johannes_at_huesing.name  from such a trifling investment of fact.                
http://derwisch.wikidot.com         (Mark Twain, "Life on the Mississippi")

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive