View Single Post
Join Date: Jan 2008
Posts: 3,826
Reputation: VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute 
Solved Threads: 501
Featured Poster
VernonDozier VernonDozier is offline Offline
Senior Poster

Re: Help with rolling dice problem

 
0
  #8
Jul 26th, 2008
Originally Posted by cmatos15 View Post
I think im getting confused when it says to /* Write a declaration of array exprected here. Assign an initializer list containing the expected values here. Use SIZE for the number of elements */

is that asking for
  1. int expected[ SIZE ] = { list containing expected values }

I guess im not sure what the expected values are, I posted the sample output to the lab and it has the expected values, but there in percentages and im not sure if thats what im suppose to list.

Expected value is a statistics term. In your case, if you roll the dice 36,000 times and you define X as the number of 7's you roll in those 36,000 trials, then E(X) = 6,000. E(X) is notation for "the expected number of times X occurs", or "expected value of X". That's derived by multiplying the probability of getting a 7 in one roll (which is 6 / 36, or 16.67%, since there are 6 ways to get a 7 and there are 36 ways to roll two dice) times 36,000. So you'll simulate 36,000 rolls and keep track of how often each score occurs, and it's unlikely you'll get exactly 6,000 sevens in 36,000 rolls, but hopefully you'll get close to that. It appears that the format you are supposed to display is in percentages, so you'll divide that number of 7's (and the other scores too) by 36,000 and display that number next to 16.67%. That number should be fairly close to 16.67%.
Reply With Quote