I came across the following puzzle online and didn’t immediately know the answer:

More logic puzzles! Here’s another one: You are given a container with 100 balls; n of them are red, and 100-n are green, where n is chosen uniformly at random in [0, 100]. You take a random ball out of the container–it’s red–and discard it. The next ball you pick (out of the 99 remaining) is: * More likely to be red * More likely to be green * Equally likely * Don’t know Bonus points if you can specify the exact probability of what happens next

Figured I could write up a little Python script before I sleep to simulate (and approximate) the chances of the next ball being red (given the first ball is red).

import random
import math
import pandas
import sys
 
def run_test(ball_count:int):
    red_balls = math.floor(random.random()*ball_count)
    first_pull = math.floor(random.random()*ball_count)
    if first_pull <= red_balls:
        red_balls -= 1
        next_pull = math.floor(random.random()*ball_count)
        if next_pull <= red_balls:
            return 1 # ball is red
        else:
            return 0 # ball is green
    else:
        return 2 # precondition (first pull is red ball) failed

def main():
    iterations = int(sys.argv[1])
    # next is green, next is red, precondition failed
    results = {
        "next ball": [0, 0, 0]
    }
    for _ in range(iterations):
         results["next ball"][run_test(100)]+=1
    print(pandas.DataFrame(results, index=["green", "red", "fail"]))

if __name__ == '__main__':
    main()

I unfortunately have no academic proof, but after running the test a couple times with various parameters, I found that after a red ball has been pulled, subsequent pulls have a higher chance being red. I this is the case because if you hold a red ball on your first pull, there is a higher chance the count of red balls in the container is greater than the count of green balls. When the precondition does not exist, it is (approximately) 50/50, even when the pulled ball is discarded.

There was a little discourse on the forum I discovered this puzzle on and I think most posts who were guessing that green is more likely to be pulled next were basing it on the fact that the red ball that was initially pulled is discarded.