Prob Test

A Probability Paradox Simulation

The Tuesday Apple Paradox

Every basket has two fruits, and at least one is an apple picked on Tuesday. Your guess is always: "The other fruit is an orange."

Classic probability says you'd win ~67% of the time with just "at least one apple." But the Tuesday constraint changes things... you should win only ~52% of the time!

Classic Mode
(Any Apple)
Tuesday Mode
(Tuesday Apple)
Fruit 1
Fruit 2

Your Statistics

0
Baskets Seen
0
Had an Orange
0%
Success Rate

Classic "at least one apple": ~66.7% (2/3)
Tuesday Apple constraint: ~51.9% (14/27)

Why 51.9%? The Tuesday Apple Breakdown

51.9%
Has Orange
(You Win)
48.1%
Both Apples
(You Lose)

The Math (Tuesday Apple Mode):

Each fruit can be: Apple or Orange, picked on any of 7 days = 14 possibilities per fruit

Two fruits = 14 × 14 = 196 total combinations

Baskets with at least one Tuesday Apple:

  • First fruit is Tuesday Apple: 14 combinations
  • Second fruit is Tuesday Apple: 14 combinations
  • Minus double-count (both Tuesday Apples): 1
  • Total valid baskets: 27

Of these 27 baskets, how many have an orange?

  • Tuesday Apple + any Orange: 7 combinations
  • Any Orange + Tuesday Apple: 7 combinations
  • Baskets with orange: 14

Result: 14/27 = 51.85%

All 27 Valid Baskets (at least one Tuesday Apple)

Has Orange (Win)
Both Apples (Lose)
Excluded (no Tuesday Apple)
14 winning + 13 losing = 27 total14/27 = 51.9%

How It Works: The Code

Data Arrays:
const DAYS = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
const FRUITS = ['Apple', 'Orange'];
Generate a Random Fruit:
function generateFruit() {
    return {
        type: FRUITS[Math.floor(Math.random() * FRUITS.length)],  // Apple or Orange
        day: DAYS[Math.floor(Math.random() * DAYS.length)]        // Any day of week
    };
}
Tuesday Mode - Rejection Sampling:
// Check if fruit is a Tuesday Apple
function isTuesdayApple(fruit) {
    return fruit.type === 'Apple' && fruit.day === 'Tuesday';
}

// Generate basket: keep trying until at least one Tuesday Apple
do {
    fruit1 = generateFruit();
    fruit2 = generateFruit();
} while (!isTuesdayApple(fruit1) && !isTuesdayApple(fruit2));
Why Rejection Sampling Matters:
Both fruits are generated independently and randomly. We reject baskets that don't meet our constraint. This correctly models "given that we know at least one is a Tuesday Apple" rather than "we picked one Tuesday Apple and generated another random fruit."

If we forced one fruit to be Tuesday Apple → 50% would have orange (wrong!)
With rejection sampling → 51.9% have orange (correct!)