Replies

Mar 12, 2018 8 years ago
Paramnesia
THESOVEREIGN
User Avatar
Captain Beatd0wn

Quote
At the moment 124 tickets have been sold for today&;s drawing.
Of these you have bought 93. Your odds of winning are: 1:41

I bought 3 mega tickets after one person had bought 1 other mega ticket.

It seems like my odds should be 75% of winning the potion lottery if it were to be held this minute, but it's saying my odds are 1:41.

Yesterday I bought 6K potion lottery tickets out of about 12K, and it never said my odds were better than 1:61.

Not the end of the world, but it seems like it is definitely glitched.

[Center] [tp=thesovereign] :dmg🔥 [tot=thesovereign] :dmg🔥 [egg=thesovereign] [spoiler=Interesting High Score Tables][url=https://subeta.net/games/battle/scores.php?enemy=206]Paramesian Buttwing Bomber[/URL] [url=https://subeta.net/games/battle/scores.php?enemy=210]Paramesian Recycle Beast[/URL] [/Spoiler][/Center]

Mar 12, 2018 8 years ago
Silverfish
is a survivor
User Avatar
Xingese

Well, I mean you also need to guess the correct type of potion to win anything? I think? Out of 31 3/4 * 1/31 = 1/41 1/2 * 1/31 = 1/62...

( probably has it closer to what it should be bc yeah that does not seem correct. But that's what it is counting :'))

Art by p-sebae ❤️
| | -Night Mode- Shengui Guo Custom CSS [v2.0]

Looking to adopt a December 31st, 1969 glitched date pet

Mar 12, 2018 8 years ago
Flying Ace
Speiro
User Avatar

I bought a couple mega tickets to test, and got a similar result:

1 mega ticket bought, 467 total tickets sold -> 1:467 reported odds 2 mega tickets bought, 529 total tickets sold -> 1:265 reported odds 3 mega tickets bought, 560 total tickets sold -> 1:187 reported odds

So it's like (your mega tickets):(total tickets) and then they simplify it to get 1 on the left? Or something similar at least, and it's the same for both of your examples. And that's way off.

For your first example, the odds should be reported as 3:1, and for my first example (if I've done the math right) the odds should be somewhere between 1:14 (if the tickets are evenly distributed between all potions) and 30:1 (if everyone else went all in on a single potion type for some bizarre reason).

here's how (I think) it should be calculated Disclaimer: I'm not super great with odds and probability, so there's a chance this is wrong. It wouldn't hurt to double check.

  1. Calculate probability for each potion type as (your tickets for this potion / total tickets for this potion)

  2. Get the total probability by adding up each of those numbers and dividing by the total number potions (31 as of right now).

  3. Odds are (probability):(1 - probability). You'll want to convert that to whole numbers though, so divide each side by the smaller number. For example, if your overall probability was 0.75, your odds are 0.75:0.25 = (0.75/0.25)[b]:/b = 3:1

And some psuedo-code in case this is clearer:

int probability = 0; foreach(potion) { probability += 1/(potion.length) * (potion[x].your_tickets / potion[x].total_tickets); } if(probability >= 0.5) { print( round(probability / (1 - probability)) + ":1"); } else { print("1:" + round((1 - probability) / probability ) ); }


Mar 12, 2018 8 years ago
Silverfish
is a survivor
User Avatar
Xingese

So my main memories from probability lectures is totally how much I want to run away screaming but it seems like right now it's calculating

1/31 * (your total tickets)/(all tickets bought)

while it? probably? should be calculating

1/31* (your tickets for potion /total tickets for potion ) + 1/31*(your tickets for potion /total tickets for potion ) + ... + 1/31* (your tickets for potion /total tickets for potion )

most of these will be 0 of course unless you bought a ticket for every potion type.

Art by p-sebae ❤️
| | -Night Mode- Shengui Guo Custom CSS [v2.0]

Looking to adopt a December 31st, 1969 glitched date pet

Mar 12, 2018 8 years ago
Flying Ace
Speiro
User Avatar

- I agree with you on what it should be calculating. I don't know about what it's actually calculating, but as long as we agree it's wrong that's what matters. :P


Mar 12, 2018 8 years ago
Paramnesia
THESOVEREIGN
User Avatar
Captain Beatd0wn

So a mega ticket buys 1 of each type of entry.

At the time I entered there were 31 tickets sold (pressumably a mega ticket.)

I then went and bought 3 megatickets.

If you want to write it out the long way the odds would be 1/31* (numbers of tickets I bought for potion A/total for potion A) + 1/31* (numbers of tickets I bought for potion B/total for potion B) +.... 1/31* (numbers of tickets I bought for potion N/total for potion N)

But when there was an even distribution of tickets previously bought and I bought an even distribution of tickets, it should always simplify down to 3/4. If someone bought 31 angelic potion tickets and 0 of anything else my odds should be closer to 30/31.

[Center] [tp=thesovereign] :dmg🔥 [tot=thesovereign] :dmg🔥 [egg=thesovereign] [spoiler=Interesting High Score Tables][url=https://subeta.net/games/battle/scores.php?enemy=206]Paramesian Buttwing Bomber[/URL] [url=https://subeta.net/games/battle/scores.php?enemy=210]Paramesian Recycle Beast[/URL] [/Spoiler][/Center]

Mar 13, 2018 8 years ago Official
Bug
User Avatar
Segfault

I am consulting with a mathematician, and will make sure this is fixed accordingly.

🐝 ☕ bug (he/him) | your friendly neighborhood code wrangler. stay in the loop! join and check out the latest admin post highlights

Mar 15, 2018 8 years ago Official
Bug
User Avatar
Segfault

I have chosen to change this page to show the probability rather than the odds for the following reasons:

  • Seeing a percentage chance is easier information to understand for most people.
  • Calculating the odds accurately turns out to be quite messy, and I feel this single use case does not justify adding a rational arithmetic library to our code base.
This change was just deployed and should be showing up on the site within a few minutes.

For those who are curious, here's some info on the accurate calculations. For both, I will assume we have n potions, and I will use t[sub]n[/sub] to represent the total number of tickets purchased for potion [i]n, and b[sub]n[/sub] to represent the number of tickets purchased for potion [i]n by the current user.

Calculating the Odds To calculate the odds, you would need to sum (b[sub]n[/sub] / t[sub]n[/sub]) for all n. However, you need to keep them in fractional form while doing so, which is where a rational arithmetic library would be helpful. The resulting sum is then divided by n the number of potions. Your final result would be a rational number written as a fraction m/n. From there, the odds would be equal to m : (n - m).

Calculating the Probability This one is so much easier. Like the odds, sum (b[sub]n[/sub] / t[sub]n[/sub]) for all n, and then divide by n. However in this case it's okay if the number is a decimal form. You can simply multiple it by 100 (and do a little rounding to make it nice) to get your percentage.

🐝 ☕ bug (he/him) | your friendly neighborhood code wrangler. stay in the loop! join and check out the latest admin post highlights

Mar 15, 2018 8 years ago
Flying Ace
Speiro
User Avatar

Quote by Bug
Calculating the Odds
To calculate the odds, you would need to sum (b[sub]n[/sub] / t[sub]n[/sub]) for all n. However, you need to keep them in fractional form while doing so, which is where a rational arithmetic library would be helpful. The resulting sum is then divided by n the number of potions. Your final result would be a rational number written as a fraction m/n. From there, the odds would be equal to m : (n - m).

So this:

Quote by Speiro
3. Odds are (probability):(1 - probability). You&;ll want to convert that to whole numbers though, so divide each side by the smaller number. For example, if your overall probability was 0.75, your odds are 0.75:0.25 = (0.75/0.25):(0.25/0.25) = 3:1

Because:

m : (n - m) m/n : (n - m)/n m/n : (1 - m/n)

You should be able to calculate the odds just fine with decimals.

But if people find probability easier to understand than odds, it's all the same in the end. I'm glad this got fixed. :)


Mar 15, 2018 8 years ago Official
Bug
User Avatar
Segfault

Quote by Speiro
You should be able to calculate the odds just fine with decimals.
This is incorrect. The issue is that we would wish odds to be displayed with whole numbers. That is no simple task. Dividing both sides by the smaller number will not yield two whole numbers unless one of them already divides the other, which is actually rarely the case.

Your method is incorrect because you haven't proved it will result in whole numbers. Dividing each side by the smaller number will rarely work, for instance, try that method with the ratio 5 to 3.5 Divide both by 3.5 and you just get 5/3.5 to 1.

🐝 ☕ bug (he/him) | your friendly neighborhood code wrangler. stay in the loop! join and check out the latest admin post highlights

Mar 15, 2018 8 years ago Official
Bug
User Avatar
Segfault

Anyway, locking as it's been fixed.

🐝 ☕ bug (he/him) | your friendly neighborhood code wrangler. stay in the loop! join and check out the latest admin post highlights

Please log in to reply to this topic.