Re: Dice Program
- From: GArlington <garlington@xxxxxxxxxxxxx>
- Date: Wed, 6 Feb 2008 02:20:38 -0800 (PST)
On Feb 5, 11:34 pm, ajts...@xxxxxxxx wrote:
I wrote a dice program that calculates the sums of two dice and shows the<snip>
frequency that they appear. I know there are 36 possible combinations for
these sums to appear. Does it matter if would roll the dice 100 times or
6000 times. Will the fraction display change? If so how would I express that
mathmatically? My other question is I declared a Random random = new
Random() in main and want to pass it to a static void method.So that way I
dont create a new object every time method is called. I thought I had it
figured out but there was same result when I comented Random random = new
Random() out. I know I need to pass in the object to my method but not sure
how. My code is as follows:
Having two dice with 6 sides (6 possible numbers each) how do you get
36 combinations?
I can find ONLY 21 different combinations and ONLY 11 different sums.
So the probability of ANY particular combination is 1 in 21 and
probability of any particular sum is 1 in 11.
Most likely your assignment is to try to prove (or disprove) your (or
my) probability assumptions.
Probability (as far as I remember from the long gone times when I was
a student) is something that works 100% ONLY in infinity, i.e. the
fewer attempts you make - the less likely you are to be close to what
probability is predicting.
.
- Follow-Ups:
- Re: Dice Program
- From: Patricia Shanahan
- Re: Dice Program
- From: Lew
- Re: Dice Program
- From: Boris Stumm
- Re: Dice Program
- References:
- Dice Program
- From: ajtst10
- Dice Program
- Prev by Date: Re: C->JNI->fast webpage updates?
- Next by Date: Re: Dice Program
- Previous by thread: Re: Dice Program
- Next by thread: Re: Dice Program
- Index(es):
Relevant Pages
|