Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Luigi Misfire is guaranteed on the 6th Green Missile or earlier, not the 8th #2500

Closed
cynidea opened this issue Aug 14, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@cynidea
Copy link

cynidea commented Aug 14, 2024

I performed an experiment where I repeatedly used Luigi's side special until I got a total of 100 Misfires, and tallied up how many attempts it took for each one. Results are below:

image

By the intended implementation, I should be seeing instances where Misfire occurs on the 7th or 8th side special, but no such instances ever occurred out of these 100 Misfires.

It is worth noting that I've entered this data into a chi-square calculator, which did not find this distribution statistically significant when assuming a 1/6th expected chance for each category.

So if you really wanted to, you could just not touch any code, declare this a simple buff to side special, and call it a day. :^)

@SuddyN
Copy link
Collaborator

SuddyN commented Aug 14, 2024

Good catch. It seems that the code for calculating misfire fails our assumptions in two ways

  • the range for random is exclusive, not inclusive
  • the result is truncated by 1

What this means is that in reality a range of 7 numbers is generated (not 8), and then that is shifted down to 6. The actual odds (for now) are:

  • 1st: 2/7
  • 2nd: 1/7
  • 3rd: 1/7
  • 4th: 1/7
  • 5th: 1/7
  • 6th: 1/7

This makes the misfire guaranteed in 6, and biased toward 1st try (twice as likely).

@moklmaru moklmaru added the bug Something isn't working label Aug 22, 2024
@jobrien97
Copy link
Collaborator

Fixed in v0.47.0 pre-release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants