Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3227992
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:38:22+00:00 2026-05-17T16:38:22+00:00

When I switch out isWinDefault with isWinConfidence I get drastically different results. I felt

  • 0

When I switch out isWinDefault with isWinConfidence I get drastically different results. I felt they should be the same. Is there a bug in my code or a property of statistics that I’ve misunderstood?

This test is meant to simulate flipping a single coin 1x vs a coin many times.

The question is

If P(x) is 70% then should p(x) * 100 be >= 70 70% of the time, no?

Thanks.

    private void TestWin()
    {
        double headsUp = 0;
        double testRuns = 100;
        for (double i = 0; i < testRuns; i++)
        {
            if (IsWinConfidence())
            {
                headsUp++;
            }

        }
        label1.Text = "Probability of Heads is " + headsUp /testRuns;

    }

    private bool IsWinDefault()
    {
        if (r.NextDouble() <= .7)
        {
            return true;
        }
        return false;
    }

    private bool IsWinConfidence()
    {
        int headsCount = 0;
        for (double x = 0; x < 100; x++)
        {
            if (IsWinDefault())
                headsCount++;

        }

        double pHeadsCount = headsCount / 100d;
        if (pHeadsCount >= .7 )
        {
            return true;
        }
        else
        {
            return false;
        }


    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:38:23+00:00Added an answer on May 17, 2026 at 4:38 pm

    Here’s the simple answer:

    A 70% probability means that on average, 100 coin flips will produce 70 heads up. It will, however, sometimes be more than 70, and sometimes less.

    In other words, the number of heads up you will get for each batch of 100 coin flips, will be close to 70. Sometimes below 70, sometimes above 70, sometimes exactly 70.

    So if the number swings around 70, it only stands to reason that if you’re asking “how often will it swing above 70, or equal to 70”, you will get an answer that says “around 50% of the time”.

    So you’re not asking the right question with your code there.

    In fact, increasing the number in your loop in IsWinConfidence to something much higher gives you a number close to 50.


    Let’s pick apart your arguments here.

    You’re saying that if you have:

    A biased coin, that 70% of the time, will land with heads up, and 30% of the time, with heads down

    Then you’re saying that:

    If I flip the coin 100 times, I should get more than 70 heads up

    One does not lead to the other, there’s a flaw in your arguments here. Probability is not about guarantees, it’s about averages.

    If probability was absolute, your second statement should be:

    If I flip the coin 100 times, I should get 70 heads up

    Notice the lack of “more than” here.

    Instead, what the first argument means is this:

    If I flip the coin 100 times, then flip it 100 more times, then 100 more times, then 100 more times, and so on, then on average each 100 flips will have 70 heads up

    Now, I don’t know enough about probability calculations to pick apart your loops and counts, but I do know that just following logic, your arguments fail.

    Let’s try another approach.

    If the coin is even, though biased, it means out of a 100 coin flips, you will sometimes get more than 70, and sometimes less than 70.

    In my naive mind, this means that… On average, you will only get more than 70 coin flips half the time.

    By increasing the numbers in your loop to 100.000, I get the confidence-function to return close to 50. This seems to back up my theory.

    But as I said, the chance of me being an expert (or even dabbler) in probability is less than zero.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to parse some html to switch out values of various element
I have to prevent Coldfusion's default list delimiter ',' from being entered into a
I have a view controller with a view that uses OpenGL ES. When that
I'm creating my first iPhone application (using XCode 4), and I initially created the
I am in the process of designing an app that will begin on an
Essentially what I would like to do is draw a circuit diagram in a
I have a click-once app that, for certain reasons I cannot republish a new
I'm working on an Android app having an always visible tabbar. However, each tab
Ok, so in creating a game in my spare time, I've been completely stuck
I'm trying to write a check to redirect users based on their progress through

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.