返回题库

概率 Expected Value Of Information

Prob Expected Value Of Information

专题
Probability / 概率
难度
L3
来源
MyntBit

题目详情

你正考虑对某事件下注。事件发生的概率 pp 未知,但建模为 0 到 1 之间的均匀随机变量(pUniform(0,1)p \sim Uniform(0, 1))。你可以选择下注:下注成本 0.50 美元;若事件发生,收益 1 美元(净利 0.50 美元);若事件不发生,损失 0.50 美元。你也可以先花费 0.10 美元获得完全信息(得知 pp 的确切值)。

任务:计算信息期望值(EVI)。先算无信息时下注的期望收益,再算有信息时下注的期望收益,EVI = 有信息期望收益 - 无信息期望收益 - 信息成本。判断是否值得购买信息。

英文原题

You are considering betting on an event. The probability, pp, of the event occurring is unknown but is modeled as a uniform random variable between 0 and 1 ( pUniform(0,1)p \sim Uniform(0, 1) ).
You have the option to bet on the event. If you bet, it costs you 0.50 dollars. If the event occurs, the bet pays you 1 dollar (for a net profit of 0.50 dollars). If the event does not occur, you lose your 0.50 dollar bet. You also have the option of not betting at all.
Currently, without any additional informatio

解析

问题分析

You are considering betting on an event. The probability, pp, of the event occurring is unknown but is modeled as a uniform random variable between 0 and 1 ( pUniform(0,1)p \sim Uniform(0, 1) ).
You have the option to bet on the event. If you bet, it costs you 0.50 dollars. If the event occurs, the bet pays y

解法

根据题目要求实现相应功能。核心逻辑需要:

// 核心数据结构和方法——根据题目 API 约定实现
// 1. 确定状态表示——选择支持所需操作的数据结构
// 2. 实现核心算法——确保 O(·) 时间复杂度和正确性
// 3. 处理边界条件——空输入、极值参数、并发访问

验证

用具体输入验证:构造已知输入的测试用例,确认输出匹配预期结果。

复杂度与边界

  • 时间复杂度:取决于选用的算法
  • 空间复杂度:取决于数据规模
  • 关键边界条件:空输入、极值参数、并发场景下的正确性保证

英文解析

Analysis

You are considering betting on an event. The probability, p, of the event occurring is unknown but is modeled as a uniform random variable between 0 and 1 (p ~ Uniform(0, 1)). You have the option to bet on the event. If you bet, it costs you 0.50 dollars. If the event occurs, the bet pays you 1 dollar (net profit of 0.50). If it does not occur, you lose your 0.50 bet. The expected value of betting without additional information is E[profit] = E[p * 0.50 + (1-p) * (-0.50)] = E[p - 0.50] = 0, since E[p] = 0.5 for Uniform(0,1). The Expected Value of Perfect Information (EVPI) measures how much you would pay to know p exactly before deciding.

Solution

double evpi_bet() {
    // Without info: E[bet profit] = 0, E[skip profit] = 0
    // With perfect info: bet only when p > 0.5
    // E[profit with info] = E[max(p - 0.5, 0)]
    double ev_with_info = 0;
    int N = 100000;
    for (int i = 0; i < N; ++i) {
        double p = (i + 0.5) / N;  // Uniform sampling
        double profit_if_bet = p * 0.5 + (1 - p) * (-0.5);
        ev_with_info += std::max(profit_if_bet, 0.0) / N;
    }
    // EVPI = E[optimal with info] - E[optimal without info]
    // Without info, optimal is indifferent (EV=0)
    // With info, only bet when p>0.5: E[p*0.5-(1-p)*0.5 | p>0.5] * P(p>0.5)
    // Analytical: EVPI = integral from 0.5 to 1 of (p-0.5) dp = 0.125
    return ev_with_info;  // Should be ~0.125
}

Complexity & Edge Cases

  • Time complexity: O(N) for numerical integration, O(1) for analytical solution
  • Space complexity: O(1)
  • Edge cases: (1) When bet has zero expected value, EVPI equals the expected gain from optimal decision (2) EVPI decreases as prior becomes more informative (3) For non-uniform priors, integration changes accordingly

Verification

Verify analytical result: EVPI = integral from 0.5 to 1 of (2p-1)/2 dp = 0.125. Numerical approximation should converge to this value. Test with different prior distributions.

Key Considerations

EVPI quantifies the maximum value of information before making a decision. In quantitative trading, this concept applies to research investment - how much should you spend on data analysis before committing capital? EVPI provides a theoretical upper bound on research spending: if the cost of obtaining information exceeds EVPI, the research is not worthwhile.