Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!feed.xsnews.nl!border-1.ams.xsnews.nl!newspump.sol.net!posts.news.twtelecom.net!nnrp2.twtelecom.net!not-for-mail From: Tomas Garza Newsgroups: comp.soft-sys.math.mathematica Subject: Re: Coin Toss Sim Date: Thu, 27 Oct 2011 10:33:56 +0000 (UTC) Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: <201110262139.RAA00063@smc.vnet.net> Lines: 21 NNTP-Posting-Date: 27 Oct 2011 09:37:43 GMT NNTP-Posting-Host: 7ed5b065.news.twtelecom.net X-Trace: DXC=4SWkQWG`gAf=e0<5NOFKkjC_A=>8kQj6mm^eQlV`f18gWQF_62=Zl3iEFiONJ7[GofDR: Date: Wed, 26 Oct 2011 17:39:20 -0400 > From: poolebc221@gmail.com > Subject: Coin Toss Sim > To: mathgroup@smc.vnet.net > > I am new to mathematica and am trying to make a coin flipping simulation however mo code isn't working. When I tell it to count the number of head it gives me a bad count. The code I am using is listed below any help would be greatly appreciated. > > y[n_] := Block[{g, s}, > > > g := RandomChoice[{"head", "tail"}, n]; > s := Count[g, "head"]; > {g, s} > ] >