Draft

Will you get head?

Description
Loading description...
Mathematics
Probability
  • Please sign in or sign up to leave a comment.
  • Sadjad Avatar

    Why the test prediction(0, 3, 1, 6) should be True. obviously there is no chance to win any prize!

    • Yushi.py Avatar

      You cannot claim that the probability of a coin landing heads is heads / total. If I threw a coin 3 times and it didn't land heads in any of those, then it's reasonable to say that the coin is unlikely to roll heads, but not impossible. 

      While I cannot tell you the actual value, you'll see that, while the probability is low, it's not zero, and it's good enough for the values of the bet.

      Issue marked resolved by Yushi.py 12 months ago
    • Yushi.py Avatar

      This comment has been hidden.

  • dietrichR Avatar

    What is the "Excpected value of the bet" and how do you calculate it.

    • Yushi.py Avatar

      This is a shitkata I've given up on, and I don't think it should be approved at all anymore. Anyway, I'll still answer your question.

      It's a mathematical concept, so I'm just repeating something you'd find on the internet.

      Let's say we have an event that can yield multiple outcomes with different values associated with each. The expected value is the sum of the probability of an outcome's value multiplied with it's probability for all outcomes of the event.

      I'll not go too much into it; there are way more sources online that can explain it better than I can.

      For this problem, the even has only two outcomes: heads or tails. If you get heads, you win the prize; if you get tails, you gain nothing.

      So the expected value is just the probability of getting heads times the prize value. It gets a bit unintuitive with negative values for the prize, but the idea remains.

      Question marked resolved by Yushi.py 12 months ago
    • dietrichR Avatar

      Thanks for explaining!

  • dfhwze Avatar

    You don't explain what "the expected value" is. Is it part of the kata for the user to figure this out? Specially, in case of a "possibly biased coin", whatever that means.

  • Voile Avatar

    This comment has been hidden.

    • Yushi.py Avatar

      I don't plan on getting this approved anymore, but I added it, they only go up to 1000, no reason in going that big for a theory focused kata.

      I didn't add the values for bet or prize because in theory they can go up to like 1_000_000 but it never does and it doesn't really matter.

      I'm just solving the issue so I don't have it marked as a due issue on my profile.

      Issue marked resolved by Yushi.py 12 months ago