MathGroup Archive 2011

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

Search the Archive

Re: average of the consecutive coin tosses


Mean[RandomInteger[{0,1},{1000}]

Regards,
	Ssezi

On Oct 6, 2011, at 4:18 AM, michael partensky wrote:

> 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: importing data into a CDF
  • Next by Date: ParallelMap in FindMinimum getting slower
  • Previous by thread: average of the consecutive coin tosses
  • Next by thread: Re: average of the consecutive coin tosses