Skip to content
DeepForgeby svx
All problems
MediumProbabilitypr-158

Two Envelopes Naive Expected Value

Problem

The two-envelope puzzle: after seeing amount in one envelope, the naive argument says the other holds 2 * amount or amount / 2 with equal probability, giving a switch expected value of 1.25 * amount.

Return [keep_value, naive_switch_value] = [amount, 1.25 * amount].

Hint

The naive calculation ignores that the amount you saw changes the distribution of what is in the other envelope.

Test cases

case 1
in: [10]
expected: [10,12.5]
case 2
in: [0]
expected: [0,0]
case 3
in: [8]
expected: [8,10]
Starter codePython
def two_envelope_naive_ev(amount):
    # Your code here
    pass

3 test cases · run your code against them in the editor