Talk:Lottery

Top prize for Unlucky Sims
Looking at the table, I don't see how prizes for Unlucky Sims top out at §100. The traits don't start affecting the prize chances until the §1,000 level is reached, and even then, it's +/- 5%. That leaves a 5% of winning §1,000, unless there are some other factors that affect the amount of the prize. Dharden (talk) 18:28, March 29, 2014 (UTC)
 * The code isn't very complicated, but it's a little confusing to explain in the article, so I tried to omit the details as it's too technical. How the game determines the outcome is actually more than what's just listed on the table.


 * Consider the winning chances aren't modified (no traits, no moodlet). First, all the weighted chances are summed up, so n = 30 + 25 + 15 + ... + 0.05 = 100. After that, a random number x is picked between 0.00 - 1.00. The random number that's picked determines the outcome of the reward:


 * Technically, if x is exactly 1.00, I believe you won't win any prize instead. The denominator is n, while the numerator is the prize's corresponding weighted chance, added by the preceding weighted chances and modified chances.


 * If the Sim has Unlucky trait, the result is a bit different. The denominator n is equal to the sum of base weighted chances, as well as the modifiers (this is applied to other factors as well, but in this case, the Sim only has Unlucky trait); n = 30 + 25 + 15 + 10 + (-5) + 7 + (-10) + 7 + (-12.5) + 5.95 + (-15) + 0.05 + (-10) = 47.5. And then x is picked between 0 and 1 again, and the outcome would be like this:


 * See, 55/47.5 is already greater than 1.00. Theoretically it's impossible to get past §100. And beyond §5,000 prize is logic error, so it's even more impossible.  Nikel  Talk  –  Vote!  06:37, March 30, 2014 (UTC)


 * As a side note, it's more precise to call it weighted chance than percentage chance. That's because the denominator isn't always 100, hence the chances don't use %.  Nikel  Talk  –  Vote!  06:41, March 30, 2014 (UTC)


 * I see. Thanks. This could be worked up and linked to as a sub-page, for people who want more details about how the calculation is done. Dharden (talk) 12:04, March 30, 2014 (UTC)


 * I've worked out the other tables in the Sandbox, but would appreciate if you'd check my math. Dharden (talk) 13:57, March 30, 2014 (UTC)


 * Those are correct, except the Lucky one. I've corrected it. I was afraid that it would confuse the reader, so I didn't include it in the article. You can make a sub-page for the table, but I don't know if the details are significant enough, especially since lotto prize isn't the only thing that has this probability calculation in the game.  Nikel  Talk  –  Vote!  17:04, March 31, 2014 (UTC)
 * Thanks. It was early morning when I did that, not surprising that I missed something. Dharden (talk) 19:14, March 31, 2014 (UTC)