I am a total newbie, and I am pretty hung up on the implementation of a random number generation into a program I am supposed to write (C++). If I am given information about the probability of possible outcomes, how do I use a random number generator to predict the future events based on said probability figures?
The program is based on the next years baseball batting pcts and such. After rereading again and again I can only assume that I use each of the possibilities that add up to 100 percent, and use each of these separately ie. the probability for a single is 20 percent, so i use if(x >= 1 && x <=20) then blah blah blah.... Kind of stuck... Any way someone can push me in the right direction?
The program is based on the next years baseball batting pcts and such. After rereading again and again I can only assume that I use each of the possibilities that add up to 100 percent, and use each of these separately ie. the probability for a single is 20 percent, so i use if(x >= 1 && x <=20) then blah blah blah.... Kind of stuck... Any way someone can push me in the right direction?