Opticraft Community

Discussion forum => Legacy => Archives => Suggestions => Topic started by: KCB38 on July 20, 2012, 12:01:12 am

Title: Fix the Lottery
Post by: KCB38 on July 20, 2012, 12:01:12 am
The lottery needs fixing. I and many other players feel like it is rigged, especailly when a player wins all 3 draws(Which happened today, 7/19) Stop with complicated formulas and just make it entirely random. And maybe make it so that the #1 winner cant win 2cnd or 3rd place.
Title: Re: Fix the Lottery
Post by: ViperZeroOne on July 20, 2012, 12:11:07 am
Wait, wait, wait...  For the last time, there's NOTHING wrong with the lottery!

With a lottery every TICKET has a chance to win.  

Say you buy 100 tickets, that's 100 chances to win over the 3 draws.

You win first place, you still have 99 tickets in the draw for second and third.
You win second place, you still have 98 tickets in the draw for third.
You win third place, you have 97 tickets that didn't win.

How exactly is that unfair?  It's perfectly fair!

Come on people, that's how lotteries work.  Every ticket you buy has a chance to win.  Just because you purchased 1 ticket and someone else purchased 1000 of them doesn't mean the person who purchased 1000 should have all their tickets disqualified after they win one of the 3 draws.

I think it would be much more unfair to disqualify a player after they win a single draw.
Title: Re: Fix the Lottery
Post by: ☣2crzy4uall☣ on July 20, 2012, 12:12:20 am
It's not rigged, the more tix you buy the higher chance of winning, that simple. so when someone wins all three keep in mind they most likely lost money buying into it
Title: Re: Fix the Lottery
Post by: SalsaInABowl on July 20, 2012, 12:34:54 am
Let's learn some math everybody. I know you hate school, I don't wanna have to teach in summer...but it's not rigged. Let's take this back to second grade, in probability.

There are 100 tickets in the lottery. Mr snapey bought 5. Mr Cazually bought 75. Mr Cazual won first and second, while I won third. Why did this happen? Well let's see. What percent of tickets were mine? 5%. What about Cazual? 75%. So Cazual would win 3/4 of the times, assuming theoretic probability. I would win one out of 20 times, again assuming theoretic probability. Rigged? You tell me.
Title: Re: Fix the Lottery
Post by: ViperZeroOne on July 20, 2012, 03:02:37 am
Let's learn some math everybody. I know you hate school, I don't wanna have to teach in summer...but it's not rigged. Let's take this back to second grade, in probability.

There are 100 tickets in the lottery. Mr snapey bought 5. Mr Cazually bought 75. Mr Cazual won first and second, while I won third. Why did this happen? Well let's see. What percent of tickets were mine? 5%. What about Cazual? 75%. So Cazual would win 3/4 of the times, assuming theoretic probability. I would win one out of 20 times, again assuming theoretic probability. Rigged? You tell me.

Haha, I actually have to adjust your mathematical equations cause the probability is PER DRAW.  I'm also going to assume that Snapey actually has 25 tickets to make the 100%.

First draw, Cazual has a 75% chance and you have a 25% chance.
(assume he wins)
Second draw, Cazual has a 74% chance and you have a 25% chance.
(assume he wins again)
Third draw, Cazual has a 73% chance and you STILL have only a 25-26% chance.

Odds are, he's gonna win the third one too.  The odds aren't that you will win 1 out of 4 times.  The odds are you only have a 1 in 4 chance PER DRAW.  That still means you can easily loose every draw.
Title: Re: Fix the Lottery
Post by: Matty585 on July 21, 2012, 01:27:16 am
I'm not an expert...but I think it would be very hard not to have complicated computer fomulas. The computer is not a human, it can not just say "Oo what's this? Oh may as well pick it...and Mr Matty won!"
Title: Re: Fix the Lottery
Post by: iGenerator on July 21, 2012, 03:26:59 am
Okay so the thing that makes the lottery so hard to win in real life, is the numbers and balls with that number there are 40 or so balls and like 6 normal ones and one colored ball. You must get every one correct to win all the money. In real life there are also millions of combinations of the numbers. Opticrafts version is much simpler, its just a random draw of peoples names out of a hat
Title: Re: Fix the Lottery
Post by: optical on July 21, 2012, 03:30:23 am
VipzerZeroOne is completely correct.

The lottery is entirely random and fair. It is just random selection without replacement.

1000 tickets bought.
Chance of first prize = 1/1000 per ticket
Chance of second prize = 1/999 per ticket (1st place ticket removed)
Chance of third prize = 1/998 per ticket (1st & 2nd place ticket removed)

No complicated formula's, no rigging. It is more of a lucky dip or raffle then a lottery, technically.

Title: Re: Fix the Lottery
Post by: raul7legend on July 21, 2012, 08:48:40 am
1000 tickets bought.
Chance of first prize = 1/1000 per ticket
Chance of first prize = 1/999 per ticket (1st place ticket removed)
Chance of first prize = 1/998 per ticket (1st & 2nd place ticket removed)
FTFY

Also, your attitude in this topic is disrespectful, snape.
On a lottery earlier I held 90% of the tickets, and I did win all three of them.
Title: Re: Fix the Lottery
Post by: ViperZeroOne on July 21, 2012, 01:41:15 pm
1000 tickets bought.
Chance of first prize = 1/1000 per ticket
Chance of first prize = 1/999 per ticket (1st place ticket removed)
Chance of first prize = 1/998 per ticket (1st & 2nd place ticket removed)
FTFY

Also, your attitude in this topic is disrespectful, snape.
On a lottery earlier I held 90% of the tickets, and I did win all three of them.

With 90% of the tickets you SHOULD win all 3 of them.  Although, there is still a 10% chance that someone is gonna get lucky.  *LOL*
Title: Re: Fix the Lottery
Post by: tiggy26668 on July 21, 2012, 02:55:47 pm
soooo, clearly if u have more tickets u have the higher chance of winning..... but out of curiosity how are the tickets stored? does it just use a random number generator and whoever has that number ticket lets say wins, or are the tickets stored in some sort of stack/list where the winner is the ticket at the index defined by the random number? more so, if they're stored in a list/stack is it being shuffled before all/each draw or at all? ya gotta keep in mind that random numbers in computers are "pseudo-random"  or "kinda random" and do have a tendency to fall in certain ranges given the algorithm used... point being if u have a giant chunk of 100 tickets in one section of this list/stack it can in fact give u an unfair advantage and increase your chance of winning.

of course this is all here say as i do not know the inner workings of the lottery, just some thoughts.

*edit* i hate criticizing without any contribution so a way to make it more random...

pseudo-code, would shuffle the tickets a random number of times....
(click to show/hide)
Title: Re: Fix the Lottery
Post by: Chief149 on July 21, 2012, 05:57:05 pm
public class Lottery
{
    private ArrayList<String> tickets; //the list that holds all the tickets purchased by the player

    public Lottery()
    {
        tickets = new ArrayList<String>(); //don't worry about this part of the code if you don't understand it
    }

    public void ticketsBought(String playerName, int numTickets) //when a player does /lottery buy numTickets command
    {
        //add the player name to the ticket list for each ticket they bought
        //if a player did /lottery buy 10 to buy 10 tickets, then their name is added to the ticket list 10 times
        for(int a = 1, a <= numTickets, a++)
        {
            tickets.Add(playerName);
        }
    }

    public void drawWinners()
    {
        //create a completely random number
        int randomNumber = (int)(Math.random()*(tickets.count()-1));
        //That random number will be the number on the list that is chosen starting with 0. So if the number 2 is
        //randomly generated, then the system goes to item number 2 on the list.
        String winner1 = tickets.get(randomNumber); //this is winner 1 randomly selected
        tickets.remove(randomNumber); //remove the individual drawn ticket from the list
       
        //repeat the above code to get winner2 and winner3

        //print winners and other crap to the chat
        //award players with their money
    }
}

That's how it works.
Title: Re: Fix the Lottery
Post by: ViperZeroOne on July 21, 2012, 06:26:38 pm
That looks completely random to me...  I don't see how you could push the randomizer to be even more random than that.
Title: Re: Fix the Lottery
Post by: ivy2112 on July 21, 2012, 06:30:53 pm
I won the lottery like cazual
if u look my signature
The prize pool was 5450$
i bhought ( by accididnt ) 645 tickets ( i wanted to buy 64 tickets )
I had ~ 93% of the prize pool tickets
i had a big chance to win as viper already said
Title: Re: Fix the Lottery
Post by: ViperZeroOne on July 21, 2012, 09:14:51 pm
I won the lottery like cazual
if u look my signature
The prize pool was 5450$
i bhought ( by accididnt ) 645 tickets ( i wanted to buy 64 tickets )
I had ~ 93% of the prize pool tickets
i had a big chance to win as viper already said

Exactly, with a 93% chance on ALL 3 DRAWS you're pretty much guaranteed to win them all.  Unless one of the other players has a horseshoe up their *cough*....
Title: Re: Fix the Lottery
Post by: tiggy26668 on July 22, 2012, 12:53:42 am
Quote
//create a completely random number
        int randomNumber = (int)(Math.random()*(tickets.count()-1));

hate to break it to you chief but that isn't random....

i wont even begin to address the complete loss of precision going on here due to using decimal values....

that whole argument aside think about the concept of multiplying a decimal between 0.0 and 1.0 inclusive times a positive integer.

first argument,
lets say we have 10^1 tickets in the lottery (never gonna happen), if the random decimal is anything equal to/smaller than .111->, (0.0, .111...) then 9*.(0.0-.111...) = 0.something, truncates to = 0
it follows (.111...2, .22...)*9 = 1.something, truncates to 1...etc all the way to (.88...9, .99....)*9 = 8.something, truncates to 8 leaving only 1.0 as the sole possible random number for the person who bought the last ticket to win, whereas the previous 9 tickets all had a seemingly equal chance to be drawn.

this thought process can be applied to larger amounts of tickets, simply move the decimal 1 place to the left for each power of 10

10^4 or 10,000 tickets
9,999*(0.0, .00011..) = 0.something
9,999*(.0001...2, .00022...) = 1.something, truncates to 1
.... etc
9,999*(.00088.....9, .00099...) = 8.something, truncates to 8
9,999*(.001...) = 9 *note only a single way to truncate to 9*

the difference in this situation is the problem repeats for every tenth ticket.

9,999*(.00188...9, .001999...) = 18.something, truncates to 18
9,999*(.002...) = 19.something, truncates to 19 *note only a single way to truncate to 19*
9,999*(.002...3) = (according to windows calc) 22.997 (WTF HAPPEND TO 20-21?!?!?!?!?!?!)

this pattern continues throughout the sequence effectively screwing over every tenth ticket as well as many others.

now if that argument isn't enough of a reason to rethink that way of generating a random number lets take into account a brief example of the "loss of precision" i wanted to avoid discussing.

lets take a simple expression, we have 10,000 tickets in the lottery and the random double is .001111,

do it on paper, 9,999*(.0001111) = .9999, truncates to 0 (perfect)

now plug it into your calculator that come standard with any windows machine

9,999*(.0001111) = 1.110889, truncates to 1 (WTF RAGE LOTTERY IS RIGGED OMFG!)

this isn't a specific situation, it reappears at specific intervals depending on the amount of bits used to store the double variable because in computer world when a decimal doesn't fit in 8 bits, the computer picks the closest number that does.

Now, with my long lecture said and done, i really hate criticizing without contributing....

in an effort to prevent problems such as these from occurring i would suggest using a random integer for your random index generation, then manipulate that number into a usable index because integer values are less prone to loss of precision, or more simply just use the nextint function and bypass it all together.

also i would suggest shuffling the list of names/tickets so that you don't end up with giant chunks of names taking advantage of the better ranges to be in, it would be an overall better mix-up/randomization as both the tickets and the index of winning tickets have been randomized

sincerely,
Tiggy

*Breathes*
Title: Re: Fix the Lottery
Post by: caseyboy123 on July 22, 2012, 01:08:41 am
Tiggy is right.
But for everyone who did not under stand that i will simplify.  Heres a scenario.  Xeadin purchases 4 tickets.  BigBadHenz purchases 3.  Nick Purchases 2 tickets. And i purchase 1.  So there are a total of 1o tickets.  each ticket is one-tenth of the total pot.  so each ticket has a ten percent chance of being chosen.  So there is a 40% chance that Xeadin will win. and a 60% chance that he wont.  So if we were to draw a ticket and put it back.  and repeat this ten times Xeadin would win 4 times while someone else would win the other 6 times.  This is according to probability. 

Now A new drawing situation.  Lets say we draw three times and each tim the ticket is removed.
Title: Re: Fix the Lottery
Post by: caseyboy123 on July 22, 2012, 01:28:33 am
wtf i wrote like a whole page and it didnt post :( it was beast
Title: Re: Fix the Lottery
Post by: caseyboy123 on July 22, 2012, 01:36:19 am
Alright im going to finish my post now.  So Xeadin has 8 tickets i have 1 and Henz has 1.  First draw Xeadin has an 80% chance of winning.  So When the computer draws Xeadin Will win.  The next Draw there are only nine tickets and Xeadin has 7 of them.  The Chance that xeadin will win is 77.7777777777777777777777777777777777777777777%  So When the computer picks one xeadin will win again. and now for the third draw Xeadin will have a 75% chance of winning. So when the Computer draws Xeadin will win again.  Now Xeadin has won all three picks.  This is because the loto is based on probability and stats.  If it was random it may be different.  But because a computer is based on satats and probability it does not draw randomely.  But this does not mean it is rigged.  So yes the loto is not random but it is not rigged.  so i hope that satisfies both sides.

Hell ya science:)
Title: Re: Fix the Lottery
Post by: tiggy26668 on July 22, 2012, 01:40:47 am
Alright im going to finish my post now.  So Xeadin has 8 tickets i have 1 and Henz has 1.  First draw Xeadin has an 80% chance of winning.  So When the computer draws Xeadin Will win.  The next Draw there are only nine tickets and Xeadin has 7 of them.  The Chance that xeadin will win is 77.7777777777777777777777777777777777777777777%  So When the computer picks one xeadin will win again. and now for the third draw Xeadin will have a 75% chance of winning. So when the Computer draws Xeadin will win again.  Now Xeadin has won all three picks.  This is because the loto is based on probability and stats.  If it was random it may be different.  But because a computer is based on satats and probability it does not draw randomely.  But this does not mean it is rigged.  So yes the loto is not random but it is not rigged.  so i hope that satisfies both sides.

Hell ya science:)

well caseyboy, the point i was trying to get at was given that algorithm some numbers actually had a lower probability to be drawn and others were being skipped completely, that means some tickets could never be drawn and others have a lower chance regardless of the amount the person bought

*edit* that means it's rigged.....
Title: Re: Fix the Lottery
Post by: ViperZeroOne on July 22, 2012, 01:52:34 am
Ok, let's set aside the algorithmic discussion for a minute because that's so WAY off from effecting the outcome of the lotto draw that it's not even worth mentioning.  It IS random, and it IS fair, because each consecutive draw doesn't include the winning ticket from the last draw, and a whole new random draw is done.  Plain and simple.

So, those of you who aren't winning, just suck it up and make the odds better in your favor.  Either find a four leaf clover, hang a horseshoe, or do something that'll improve your luck cause the odds of winning are only as good as the number of tickets you buy.

...and if you want to talk about algorithmic randomizations, even Turing had a way to randomize the algorithm that selects the random number for it's random selections, which made it's random selections 100% random.  Do you honestly think Opti wouldn't make the draws random in the same method?

Come on people, get real.
Title: Re: Fix the Lottery
Post by: tiggy26668 on July 22, 2012, 01:55:50 am
Ok, let's set aside the algorithmic discussion for a minute because that's so WAY off from effecting the outcome of the lotto draw that it's not even worth mentioning.  It IS random, and it IS fair, because each consecutive draw doesn't include the winning ticket from the last draw, and a whole new random draw is done.  Plain and simple.

So, those of you who aren't winning, just suck it up and make the odds better in your favor.  Either find a four leaf clover, hang a horseshoe, or do something that'll improve your luck cause the odds of winning are only as good as the number of tickets you buy.

viper it effects the outcome big time if that's the algorithm being used..... it means that you would be paying for a ticket that has a 0% chance to be drawn.... not a .00000001% chance, a 0% chance. it's tossing your money in the trash for false hope.
Title: Re: Fix the Lottery
Post by: ViperZeroOne on July 22, 2012, 01:58:41 am
Ok, let's set aside the algorithmic discussion for a minute because that's so WAY off from effecting the outcome of the lotto draw that it's not even worth mentioning.  It IS random, and it IS fair, because each consecutive draw doesn't include the winning ticket from the last draw, and a whole new random draw is done.  Plain and simple.

So, those of you who aren't winning, just suck it up and make the odds better in your favor.  Either find a four leaf clover, hang a horseshoe, or do something that'll improve your luck cause the odds of winning are only as good as the number of tickets you buy.

viper it effects the outcome big time if that's the algorithm being used..... it means that you would be paying for a ticket that has a 0% chance to be drawn.... not a .00000001% chance, a 0% chance. it's tossing your money in the trash for false hope.

...and has Opti come on here himself and said that's the algorithm being used?  No.  The person who posted the code is Chief149, who has no access to the server back-end and no idea what changes Opti might have made to improve the lottery plugin.  So what's the debate about?!  

Opti has come on and said that my explanation (WAY BACK) is the correct one.  That each draw is completely random, and your odds of winning are based solely on the number of tickets in your hand.  You're throwing around facts and figures that have no basis in this server's reality.  So once again, what's the debate about?
Title: Re: Fix the Lottery
Post by: tiggy26668 on July 22, 2012, 02:04:37 am
Ok, let's set aside the algorithmic discussion for a minute because that's so WAY off from effecting the outcome of the lotto draw that it's not even worth mentioning.  It IS random, and it IS fair, because each consecutive draw doesn't include the winning ticket from the last draw, and a whole new random draw is done.  Plain and simple.

So, those of you who aren't winning, just suck it up and make the odds better in your favor.  Either find a four leaf clover, hang a horseshoe, or do something that'll improve your luck cause the odds of winning are only as good as the number of tickets you buy.

viper it effects the outcome big time if that's the algorithm being used..... it means that you would be paying for a ticket that has a 0% chance to be drawn.... not a .00000001% chance, a 0% chance. it's tossing your money in the trash for false hope.

...and has Opti come on here himself and said that's the algorithm being used?  No.  So what's the debate about?!  He has come on and said that my explanation (WAY BACK) is the correct one.  That each draw is completely random, and your odds of winning are based solely on the number of tickets in your hand.  So once again, what's the debate about?

i suppose i would just love to know the algorithm being used, so that i might test it like i did that one, and ease my conscious knowing that it wont skip numbers randomly, and so that i could assure myself that the chances  of each ticket being drawn really is fair to an acceptable degree.... from what I've experienced since the lotto was implemented it appears to be quite unfair so I apologize for being concerned for myself and everyone else who feels cheated.....
Title: Re: Fix the Lottery
Post by: ViperZeroOne on July 22, 2012, 06:21:00 am
Concern is fine, but when the person who actually modified and implemented the code (Optical) says nothing is wrong with it, then nothing is wrong with it.  With all the coding repairs he's already done on this server, I think we can trust that he's fixed a randomized number.
Title: Re: Fix the Lottery
Post by: optical on July 22, 2012, 01:38:43 pm
I hate to crush such a long winded post, but tiggy is completely wrong. Thats not how things work in computers - its stored in binary - not base 10.

See: http://en.wikipedia.org/wiki/Floating_point#Floating-point_arithmetic_operations
It's complicated stuff, don't worry too much about it.

The numbers are generated using a linear congruential generator - java.Random. For this type of number generation it is adequate. see http://en.wikipedia.org/wiki/Linear_congruential_generator
http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Random.html#nextInt(int)
Title: Re: Fix the Lottery
Post by: DeeKay on July 22, 2012, 01:44:53 pm
I hate to crush such a long winded post, but tiggy is completely wrong. Thats not how things work in computers - its stored in binary - not base 10.

See: http://en.wikipedia.org/wiki/Floating_point#Floating-point_arithmetic_operations
It's complicated stuff, don't worry too much about it.

The numbers are generated using a linear congruential generator - java.Random. For this type of number generation it is adequate. see http://en.wikipedia.org/wiki/Linear_congruential_generator
http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Random.html#nextInt(int)
Indeed, I was about to say that.
Title: Re: Fix the Lottery
Post by: tiggy26668 on July 22, 2012, 07:03:45 pm
I hate to crush such a long winded post, but tiggy is completely wrong. Thats not how things work in computers - its stored in binary - not base 10.

See: http://en.wikipedia.org/wiki/Floating_point#Floating-point_arithmetic_operations
It's complicated stuff, don't worry too much about it.

The numbers are generated using a linear congruential generator - java.Random. For this type of number generation it is adequate. see http://en.wikipedia.org/wiki/Linear_congruential_generator
http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Random.html#nextInt(int)

Opti... it really goes against my better judgement to argue with you... and since i don't know the algorithm being used to generate the random numbers i can't actually disprove its reliability mathematically. However i can confidently say that i was not wrong in my earlier post, this algorithm "int randomNumber = (int)(Math.random()*(tickets.count()-1));" was rigged, and while i explained it in base 10, the principles of math don't actually change and it would've been much more confusing to try and explain it in base 2, because to do the math in base 2 would mean an even longer winded post that dives into the explanations of why a computer can't represent repeating decimals in 64bits regardless of how they're generated

and that, given the algorithm i was addressing at the time, would mean constricting the ability of the ranges (ie:0.0, .1111) to truncate to a ticket index even further as decimals such as .11111-> can't be represented accurately. this in turn gives an unfair advantage to certain ranges as repeating decimals were not created equally and can appear in different concentrations for different ranges.

However that algorithm isn't necessarily the one being used, unless of course you would like to say otherwise.
Unfortunately given the documentation you were so kind as to post one can only assuming you're using a floating point decimal to create random numbers, and of course java's lovely math.random class to generate said floating point decimal

Now, if you would be so kind as to go back to the documentation you linked and scroll down the page slightly.... you'd see what i was talking about...

http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems (http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems)

furthermore the link to java's random class doesn't really prove anything.... as we can only assume you're using floating point numbers and there's really no explanation of how they work there.... however if we were to go to the documentation on java's math class (the class from which random inherits) http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html (http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html)
 you would be be aware of this
(click to show/hide)

which basically states that when a number doesn't fit in the amount of space provided (64bits) it rounds up or down

Furthermore, you've stated you're using a linear congruential generator, which leaving this little tidbit aside
(click to show/hide)

think about this, java is capable of generating 2^48 possible random floating point numbers - http://en.wikipedia.org/wiki/Linear_congruential_generator (http://en.wikipedia.org/wiki/Linear_congruential_generator)

"As shown above, LCG's do not always use all of the bits in the values they produce. The Java implementation produces 48 bits with each iteration but only returns the 32 most significant bits from these values. This is because the higher-order bits have longer periods than the lower order bits" - http://en.wikipedia.org/wiki/Linear_congruential_generator (http://en.wikipedia.org/wiki/Linear_congruential_generator)

however in actual practice java creates only 2^24 possible random float values - http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Random.html#nextFloat() (http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Random.html#nextFloat())

this is in direct correlation with the fact that some numbers can't be represented in 64bit binary such as .111->, .222->,
.525252525252->

what this all boils down to is the misrepresentation of decimals in base 2, which leads to erroneous calculations and inaccurate results, on the surface it seems insignificant, but when u do out the math u realize probability wise some numbers have an unfair advantage while others don't show up at all, and that equates to tickets that can never be drawn and ones that don't have the correct chance to be drawn. That in fact would be the definition of rigged.

Sincerely,
Tiggy

P.S. opti, i don't mean to question your intelligence, clearly you're capable to have made it this far, however i really like randomness, and you questioned mine.
Title: Re: Fix the Lottery
Post by: ☣2crzy4uall☣ on July 22, 2012, 07:38:40 pm
For this type of number generation it is adequate.

Really this is where it should end, its an in game lottery for fake money, we don't need a top notch number generator.


Edit: Great minds Viper. lol
Title: Re: Fix the Lottery
Post by: ViperZeroOne on July 22, 2012, 07:39:18 pm
For this type of number generation it is adequate.

I think this is the statement that Tiggy missed here...  For the purposes of THIS lottery you don't have to be random down to the 50th decimal point, it's not that critical, and EVERY number has an equal chance to be selected.

If you don't think it's random enough, don't use it.  Plain and simple.



EDIT:  Ninja'd by 2crzy4uall... *LOL*
Title: Re: Fix the Lottery
Post by: tiggy26668 on July 22, 2012, 07:43:15 pm
For this type of number generation it is adequate.

Really this is where it should end, its an in game lottery for fake money, we don't need a top notch number generator.

2crazy4uall, using decimal/floating point numbers for index generation opens the possibility to skip indexes and give others higher/lower probabilities. that means people would be paying for a ticket that can't win. yes if someone buys 99 tickets and u have 1 u have 1/100 chance to win but with float values being used u could potentially have a 0/99 chance to win.
Title: Re: Fix the Lottery
Post by: ☣2crzy4uall☣ on July 22, 2012, 07:46:56 pm
Our argument is, does it really matter? I don't base all my gameplay off this lottery, I have no qualms with having a 0/99 chance. I bought 1100 tix the first round and lost, its just not a big deal
Title: Re: Fix the Lottery
Post by: iGenerator on July 22, 2012, 07:54:39 pm
Optical has stated twice in this thread how it works, can it be locked?
Title: Re: Fix the Lottery
Post by: optical on July 22, 2012, 08:29:07 pm
Tiggy, please read my post - your rant is once again completely irrelevant as I stated. I linked the exact method being used.
http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Random.html#nextInt(int)
That is the method being used to generate the numbers. Once again, it is random enough for this kind of simulation. The only time these forms of generators are not adequate is when a large slew of numbers of generated and assumed to be entirely uniform, such as in experimental data - or in cryptography, and even then the bias is generally quite small.