Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Help with adjusting integers on a bell curve
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
syntribos




PostPosted: Thu Dec 20, 2012 6:56 pm   Post subject: Help with adjusting integers on a bell curve

Is it possible to adjust a random integer (or any integer) on a bell curve (so that numbers closer to the middle appear more frequently, and less on the edges)?

I'm creating a 'Texas Hold 'em' program for my computer science at school, and wanted to add a multiplier on the bets given by the computers (e.g. a bet of $500 gets a multiplier of .93 and becomes $465). I wanted the bets to have a potential multiplier between ? 50%, but would like lower multipliers to appear more frequently.
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Thu Dec 20, 2012 7:08 pm   Post subject: RE:Help with adjusting integers on a bell curve

Turing has no built-in way to do this, but you can write a function that uses the random() funcion to generate random numbers on a curve.
Tony




PostPosted: Thu Dec 20, 2012 8:59 pm   Post subject: Re: RE:Help with adjusting integers on a bell curve

Insectoid @ Thu Dec 20, 2012 7:08 pm wrote:
but you can write a function that uses the random() funcion to generate random numbers on a curve.

A specific example is that a sum of rolling two random die has a bellcurve distribution.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: