Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5509 > unrolled thread

Re: average of the consecutive coin tosses

Started bySseziwa Mukasa <mukasa@gmail.com>
First post2011-10-07 09:10 +0000
Last post2011-10-07 09:10 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: average of the consecutive coin tosses Sseziwa Mukasa <mukasa@gmail.com> - 2011-10-07 09:10 +0000

#5509 — Re: average of the consecutive coin tosses

FromSseziwa Mukasa <mukasa@gmail.com>
Date2011-10-07 09:10 +0000
SubjectRe: average of the consecutive coin tosses
Message-ID<j6mflo$7n1$1@smc.vnet.net>
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

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web