Beginner C/C++

Moderators: None (Apply to moderate this forum)
Number of threads: 5430
Number of posts: 16951

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Random number generation Posted by Thordaddy77 on 10 Oct 2012 at 9:59 PM
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?

Thread Tree
Thordaddy77 Random number generation on 10 Oct 2012 at 9:59 PM
Thordaddy77 Re: Random number generation on 11 Oct 2012 at 8:19 PM
Thordaddy77 Re: Random number generation on 11 Oct 2012 at 8:21 PM



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.