Re: How to simulate random samples from crooked coin toss?

• To: mathgroup at smc.vnet.net
• Subject: [mg58517] Re: How to simulate random samples from crooked coin toss?
• From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
• Date: Tue, 5 Jul 2005 04:52:25 -0400 (EDT)
• Organization: Uni Leipzig
• Sender: owner-wri-mathgroup at wolfram.com

```Hi,

say a 1 mean a head and a 0 mean a tail than

will generate one realisation of your random
variable
and with

you get a sample of the random variable,
here is the number of "heads"  in the sample
Count[sample, 1]

and here the number of tails

Count[sample, 0]

Regards

Jens

"DAN BIKLE" <dbikle at gmail.com> schrieb im
> Math People,
>
> I'm new to Mathematica so please bear with me.
>
> I have a simple problem I want to solve and I'm
> looking
> for some ideas to get started on it.
>
> I want to simulate 100 tosses of a crooked coin
> where
> probability of Heads is 0.6 and Tails is 0.4.
>
> After I figure the coin out, I want to move on
> to crooked
> dice and crooked card decks.
>
> So, really what I'm looking for has more to do
> with developing
> a method to simulate the collection of random
> samples.
>
> I looked around in Help and found a promising
> sentence:
>
> "Random[distribution] gives a random number with
> the specified
> statistical distribution."
>
> Then I found a page here which has some clues:
> http://mathworld.wolfram.com/DiscreteDistribution.html
>
> Unfortunately, I'm weak with math notation so
> the above
> page makes little sense to me.
>
> So, let me put it to you as simply as I can:
>
> I want to define a function that could be called
> like this:
>
> numberOfTosses, tail]
>
> Once I figure out how to write the above
> function,
> I could template off of it to build something
> like this:
>
> numberOfRolls, aOne]
>
> Do any of you have thoughts on how to approach
> the
> writing of the above functions?
>
> -Dan
> --
> dbikle at gmail.com
>

```

• Prev by Date: Re: display of function
• Next by Date: Re: Re: Re: Re: Can't assign value to symbols
• Previous by thread: Re: How to simulate random samples from crooked coin toss?
• Next by thread: Re: How to simulate random samples from crooked coin toss?