MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Coin Toss Sim

  • To: mathgroup at
  • Subject: [mg122396] Re: Coin Toss Sim
  • From: Rui <rui.rojo at>
  • Date: Thu, 27 Oct 2011 06:31:51 -0400 (EDT)
  • Delivered-to:
  • References: <j89v28$8e$>
  • Reply-to: comp.soft-sys.math.mathematica at

Every place you write g it runs the RandomChoice code again. So, the values of g it uses when evaluating your s in {g, s} is not the same as the one it uses in the g in {g, s}.
You want the list for the same realization. I would write something like
    {g=RandomChoice[{"head", "tail"}, n]},
    {g, Count[g, "head"]}

  • Prev by Date: Combine sqrts in denominator
  • Next by Date: Re: Coin Toss Sim
  • Previous by thread: Re: Coin Toss Sim
  • Next by thread: Re: Coin Toss Sim