返回题库

金融 波动拖累与几何收益

Finance Volatility Drag Geometric

专题
Finance / 金融
难度
L2
来源
MyntBit

题目详情

某投资经历显著波动:第一年盈利 20%,第二年亏损 20%。初始投资 100 美元。两年后的终值是多少?

任务:计算终值 = 100 × 1.20 × 0.80 = 96 美元。虽然算术平均回报为 0%((+20% + (-20%))/2),实际亏损 4%。此现象称为波动率拖累:几何平均回报 = √(1.20 × 0.80) - 1 = √0.96 - 1 ≈ -2.02%,始终低于算术平均。

英文原题

An investment experiences significant volatility. In the first year, it gains 20%. In the second year, it loses 20%. You start with an initial investment of 100 dollars. What is the final value of the investment after these two years, reflecting the impact of volatility?

解析

问题分析

An investment experiences significant volatility. In the first year, it gains 20%. In the second year, it loses 20%. You start with an initial investment of 100 dollars. What is the final value of the investment after these two years, reflecting the impact of volatility?

解法

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

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

验证

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

复杂度与边界

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

英文解析

Analysis

An investment experiences significant volatility. In the first year, it gains 20%. In the second year, it loses 20%. Starting with 100,thefinalvalueaftertwoyearsis1001.200.80=100, the final value after two years is 100 * 1.20 * 0.80 =96. This 4% loss despite equal-magnitude gains and losses is volatility drag - the mathematical reality that geometric mean returns are always less than arithmetic mean returns when volatility is nonzero.

Solution

double volatilityDragExample() {
    double initial = 100.0;
    double year1_return = 0.20;  // +20%
    double year2_return = -0.20; // -20%
    double final_value = initial * (1 + year1_return) * (1 + year2_return);
    double arithmetic_mean = (year1_return + year2_return) / 2;  // = 0%
    double geometric_mean = std::sqrt((1 + year1_return) * (1 + year2_return)) - 1;  // = -2.02%
    double drag = arithmetic_mean - geometric_mean;  // = 2.02%
    return final_value;  // $96
}

Complexity & Edge Cases

  • Time complexity: O(1)
  • Space complexity: O(1)
  • Edge cases: (1) Higher volatility increases drag (2) Drag = 0 when all returns are equal (3) For log returns: drag = variance/2

Verification

Verify final_value = 96. Compute geometric mean = sqrt(1.2 * 0.8) - 1 = -0.0202. Drag = 0 - (-0.0202) = 0.0202. Verify that drag equals approximately variance/2 for small returns.

Key Considerations

Volatility drag explains why geometric mean returns are always less than arithmetic mean returns for volatile investments. The drag increases with volatility: a 30% gain followed by 30% loss leaves you at $91 (9% drag). This mathematical reality is why long-term investors prefer lower volatility - the drag compounds over time, making high-volatility strategies significantly worse than their arithmetic mean suggests.