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


Groups > comp.soft-sys.math.mathematica > #5421

average of the consecutive coin tosses

From michael partensky <partensky@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject average of the consecutive coin tosses
Date 2011-10-06 08:19 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j6jobf$lv7$1@smc.vnet.net> (permalink)

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

average of the consecutive coin tosses michael partensky <partensky@gmail.com> - 2011-10-06 08:19 +0000
  Re: average of the consecutive coin tosses Jonas <coroa@online.de> - 2011-10-07 09:01 +0000
  Re: average of the consecutive coin tosses Peter Pein <petsie@dordos.net> - 2011-10-07 09:10 +0000
  Re: average of the consecutive coin tosses Peter Pein <petsie@dordos.net> - 2011-10-07 09:11 +0000
  Re: average of the consecutive coin tosses "Dr. Wolfgang Hintze" <weh@snafu.de> - 2011-10-08 18:49 +0000

csiph-web