Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

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

Search the Archive

average of the consecutive coin tosses

  • To: mathgroup at smc.vnet.net
  • Subject: [mg121879] average of the consecutive coin tosses
  • From: michael partensky <partensky at gmail.com>
  • Date: Thu, 6 Oct 2011 04:18:15 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Hi.

What are the better ways of doing what this guy does very inefficiently for
the average of the consecutive coin tosses:

tr = (flips = 1; (#/flips++) & /@ Accumulate[Table[toss, {1000}]]) // N);

where

toss= RandomInteger[];

Thanks
Michael


  • Prev by Date: Re: Solve - takes very long time
  • Next by Date: importing data into a CDF
  • Previous by thread: Re: Dynamic evaluation not automatically enabled in CDF documents
  • Next by thread: Re: average of the consecutive coin tosses