How to do a simulation of three fair dice 1000 times? Could someone give me some help on how to start this?
You can use any programming language or even Excel. In Excel use the formula =randbetween(1,6). Place it in three columns then copy down 1000 rows. A bit tedious but works.
Fill series in Excel = home ribbon, fill on right side of screen, select series, then 1, 1000, and columns
okay thank you, I now have to calculate the sum of each column, I think. It says: " Create a relative frequency graph of the sums obtained" ...my question is...how do i obtain the sums? Would it be the 1001th cell in the first second and third columns? or a new cell block
Guessing about your problem, I believe that you want to create a sum of each set of 3 digits. IN the fourth column, type =sum(A1:B1) and fill down. From there you need to calculate the lookup.
Here is a Java solution public static void main(String[] args) { // TODO code application logic here int die1=0; int die2=0; int die3 = 0; int roll = 0; int totals[] = {0,0,0,0,0,0,0,0,0,0,00,0,0,0,0,0,0,0,0}; for(int x=0; x < 1000; x++){ die1 = (int) (Math.random()*6) + 1; die2 = (int) (Math.random()*6) + 1; die3 = (int) (Math.random()*6) + 1; roll = die1 + die2 + die3; totals[roll]++; System.out.println(die1+ " "+ die2+ " "+ die3); } for(int x=3; x < 18; x++){ System.out.println(x + " = " + totals[x]); } } }
to complete the counting you need to use countif, see my file I attached.
i am so confused, ton the attatched file, there are the first 10 trials out of the 1000 i have, how do i create the relative frequency?
in the next blank column, enter the numbers 3, 4,5,... 18 each in their own cell,down then next to the 3 enter the expression =countif(your range of sums here, 3) repeat for each number. If you are good, you can use the cell nuberholding 3 instead of 3 and simply drag down.
what would i enter as my range?
or how would i enter it, because i know my range of sums is 3-18
based on your picture D2:d10
so it would be D2:D1000
ex: =countif(d2:d1000,3) yes
once you get the values, highlite from the 3 to the formula next to countif and create a graph It should represent a curve with the middle values the highest
please assume that the 25 rows are really all of my 1000. The D block is: A+B+C blocks, for the E block, i would type in the function: = ? inorder to get the relatvie frequency
i type into E2: =Countif(D2:D1000,3) and it is not excepting it
=countif(d2:d25,3) =countif(d2:d25,4) =countif(d2:d25,5) =countif(d2:d25,6) =countif(d2:d25,7) =countif(d2:d25,8) =countif(d2:d25,9) =countif(d2:d25,10) =countif(d2:d25,11) =countif(d2:d25,12) etc
it worked! and if went from 666666...55555555...4444...3333333.....222222.....11111 all the way down to 1000?
numbers are all too high, I think that your fill series filled numbers instead of random functions, check out my file - I assure you it is clean and malware free.
i opened up the attatchment, and i sort of understand what is going on, however, what is the G and H blocks? and why do they start at the 11th row?
I am not sure why i started them there, blame it on my really slow laptop. The numberss in G represents the possible sums. The numbers in H are the actual counts of each possible sum
okay, i understand, i am going to try to enter what you did in the G and H blocks and see what i come up with
when i enter =Countif(D2:D1000,3) it just gives me a whole bunch of sixes, looks like this: 6666666666.....5555555.........444444444........3333333.......22222222.....1111111......00000000 ):
whatever, i will continue tomorrow, thankk you for your help!
good luck
thanks
Join our real-time social learning platform and learn together with your friends!