Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5912
| 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 <tgarza10@msn.com> |
| 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 <steve@smc.vnet.net>, Moderator |
| Message-ID | <j8bc2k$8o7$1@smc.vnet.net> (permalink) |
| 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:<QRA4F0f |
| X-Complaints-To | abuse@twtelecom.net |
| Xref | x330-a1.tempe.blueboxinc.net comp.soft-sys.math.mathematica:5912 |
Show key headers only | View raw
Try
In[2]:= Tally@RandomChoice[{"head", "tail"}, 1000]
Out[2]= {{"tail", 488}, {"head", 512}}
-Tomas
> 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}
> ]
>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Coin Toss Sim Tomas Garza <tgarza10@msn.com> - 2011-10-27 10:33 +0000
csiph-web