{"problem_id": "QCOT-STOCH-0001", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.55$, $\\sigma_1 = 0.296$, and $\\sigma_2 = 0.22$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.08762 S_t^2 V_t + -0.07163 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.08762*S^2*V + -0.07163*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.08762 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 106.18, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.55 * dW1 + np.sqrt(1 - -0.55**2) * dZ\ndS = 0.1161 * S0 * dt + 0.296 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.22 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1161*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.08762*S0**2*V0 + -0.07163*S0**2*np.sqrt(V0))*dt + 2*0.296*S0**2*V0*dW1 + 0.22*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0002", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.026$ and volatility $\\sigma = 0.265$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 93.3$ at maturity $T = 0.71$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 93.3, 0)$.", "ground_truth_answer": "dV/dt + 0.026*S*dV/dS + 0.5*0.07023*S^2*d2V/dS2 - 0.026*V = 0, V(S, 0.71) = max(S - 93.3, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 93.3, 0.026, 0.265, 0.71\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0003", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 1.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.00e-07$, temporary impact is $\\eta = 4.85e-05$, and trader risk aversion is $\\lambda = 8.34e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{8.34e-05 \\times 0.09}{4.85e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(1.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(8.34e-05 * 0.09 / 4.85e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 1.8, 4.85e-05, 8.34e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0004", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 93.64$, paying a known discrete dividend $D = 1.61$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 93.67$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 93.64$, $D e^{-r t_D} = 1.5702$, and $K e^{-r T} = 89.1017$.\nTheoretical difference $C_0 - P_0 = 93.64 - 1.5702 - 89.1017 = 2.9681$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 2.9681)$.", "ground_truth_answer": "C0 - P0 = 2.9681, Lower bound = 2.9681", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 93.64, 93.67, 1.61, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 2.9681, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0005", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.01$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.53$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.53) * q, dxi/dt = (xi^2 - 0.01*xi) / 0.53, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.53, 0.01, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0006", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 6.9$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.9}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.7250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.9\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0007", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.46$, $\\sigma_1 = 0.223$, and $\\sigma_2 = 0.191$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04973 S_t^2 V_t + 0.03919 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.04973*S^2*V + 0.03919*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04973 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 70.92, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.46 * dW1 + np.sqrt(1 - 0.46**2) * dZ\ndS = 0.0634 * S0 * dt + 0.223 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.191 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0634*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.04973*S0**2*V0 + 0.03919*S0**2*np.sqrt(V0))*dt + 2*0.223*S0**2*V0*dW1 + 0.191*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0008", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.043$ and volatility $\\sigma = 0.396$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 98.7$ at maturity $T = 1.79$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 98.7, 0)$.", "ground_truth_answer": "dV/dt + 0.043*S*dV/dS + 0.5*0.15682*S^2*d2V/dS2 - 0.043*V = 0, V(S, 1.79) = max(S - 98.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 98.7, 0.043, 0.396, 1.79\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0009", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 4.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 9.40e-07$, temporary impact is $\\eta = 4.20e-06$, and trader risk aversion is $\\lambda = 9.49e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.49e-05 \\times 0.09}{4.20e-06}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(4.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.49e-05 * 0.09 / 4.2e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 4.9, 4.2e-06, 9.49e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0010", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 106.17$, paying a known discrete dividend $D = 1.20$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 96.09$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 106.17$, $D e^{-r t_D} = 1.1704$, and $K e^{-r T} = 91.4036$.\nTheoretical difference $C_0 - P_0 = 106.17 - 1.1704 - 91.4036 = 13.5960$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 13.5960)$.", "ground_truth_answer": "C0 - P0 = 13.5960, Lower bound = 13.5960", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 106.17, 96.09, 1.2, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 13.596, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0011", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.037$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.41$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.41) * q, dxi/dt = (xi^2 - 0.037*xi) / 1.41, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.41, 0.037, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0012", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 3.4$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.4}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.8500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.4\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0013", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.47$, $\\sigma_1 = 0.301$, and $\\sigma_2 = 0.185$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.2718 S_t^3 V_t + -0.07852 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.2718*S^3*V + -0.07852*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.2718 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 108.66, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.47 * dW1 + np.sqrt(1 - -0.47**2) * dZ\ndS = 0.0546 * S0 * dt + 0.301 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.185 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0546*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.2718*S0**3*V0 + -0.07852*S0**3*np.sqrt(V0))*dt + 3*0.301*S0**3*V0*dW1 + 0.185*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0014", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.031$ and volatility $\\sigma = 0.392$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 111.0$ at maturity $T = 1.91$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 111.0, 0)$.", "ground_truth_answer": "dV/dt + 0.031*S*dV/dS + 0.5*0.15366*S^2*d2V/dS2 - 0.031*V = 0, V(S, 1.91) = max(S - 111.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 111.0, 0.031, 0.392, 1.91\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0015", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 3.3$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.64e-06$, temporary impact is $\\eta = 3.66e-05$, and trader risk aversion is $\\lambda = 3.33e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.33e-05 \\times 0.09}{3.66e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(3.3) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.33e-05 * 0.09 / 3.66e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 3.3, 3.66e-05, 3.33e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0016", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 100.42$, paying a known discrete dividend $D = 2.69$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 109.22$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 100.42$, $D e^{-r t_D} = 2.6236$, and $K e^{-r T} = 103.8933$.\nTheoretical difference $C_0 - P_0 = 100.42 - 2.6236 - 103.8933 = -6.0969$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -6.0969, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 100.42, 109.22, 2.69, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -6.0969, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0017", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.021$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.74$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.74) * q, dxi/dt = (xi^2 - 0.021*xi) / 1.74, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.74, 0.021, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0018", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 9.7$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.7}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.4250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.7\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0019", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.77$, $\\sigma_1 = 0.209$, and $\\sigma_2 = 0.133$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04368 S_t^2 V_t + -0.04281 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.04368*S^2*V + -0.04281*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04368 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 141.06, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.77 * dW1 + np.sqrt(1 - -0.77**2) * dZ\ndS = 0.0621 * S0 * dt + 0.209 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.133 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0621*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.04368*S0**2*V0 + -0.04281*S0**2*np.sqrt(V0))*dt + 2*0.209*S0**2*V0*dW1 + 0.133*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0020", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.066$ and volatility $\\sigma = 0.2$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 80.2$ at maturity $T = 1.72$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 80.2, 0)$.", "ground_truth_answer": "dV/dt + 0.066*S*dV/dS + 0.5*0.04000*S^2*d2V/dS2 - 0.066*V = 0, V(S, 1.72) = max(S - 80.2, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 80.2, 0.066, 0.2, 1.72\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0021", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 4.7$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.59e-06$, temporary impact is $\\eta = 3.97e-05$, and trader risk aversion is $\\lambda = 6.10e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.10e-05 \\times 0.09}{3.97e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(4.7) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.1e-05 * 0.09 / 3.97e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 4.7, 3.97e-05, 6.1e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0022", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 103.02$, paying a known discrete dividend $D = 2.70$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 108.30$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 103.02$, $D e^{-r t_D} = 2.6333$, and $K e^{-r T} = 103.0181$.\nTheoretical difference $C_0 - P_0 = 103.02 - 2.6333 - 103.0181 = -2.6314$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -2.6314, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 103.02, 108.3, 2.7, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -2.6314, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0023", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.014$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.06$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.06) * q, dxi/dt = (xi^2 - 0.014*xi) / 1.06, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.06, 0.014, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0024", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 4.6$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.6}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.1500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.6\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0025", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.61$, $\\sigma_1 = 0.327$, and $\\sigma_2 = 0.194$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.32079 S_t^3 V_t + -0.11609 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.32079*S^3*V + -0.11609*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.32079 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 159.44, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.61 * dW1 + np.sqrt(1 - -0.61**2) * dZ\ndS = 0.091 * S0 * dt + 0.327 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.194 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.091*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.32079*S0**3*V0 + -0.11609*S0**3*np.sqrt(V0))*dt + 3*0.327*S0**3*V0*dW1 + 0.194*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0026", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.071$ and volatility $\\sigma = 0.33$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 89.4$ at maturity $T = 0.88$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 89.4, 0)$.", "ground_truth_answer": "dV/dt + 0.071*S*dV/dS + 0.5*0.10890*S^2*d2V/dS2 - 0.071*V = 0, V(S, 0.88) = max(S - 89.4, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 89.4, 0.071, 0.33, 0.88\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0027", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 1.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.66e-06$, temporary impact is $\\eta = 2.19e-05$, and trader risk aversion is $\\lambda = 3.50e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.50e-06 \\times 0.09}{2.19e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(1.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.5e-06 * 0.09 / 2.19e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 1.4, 2.19e-05, 3.5e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0028", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 90.63$, paying a known discrete dividend $D = 1.63$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 102.73$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 90.63$, $D e^{-r t_D} = 1.5898$, and $K e^{-r T} = 97.7198$.\nTheoretical difference $C_0 - P_0 = 90.63 - 1.5898 - 97.7198 = -8.6796$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -8.6796, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 90.63, 102.73, 1.63, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -8.6796, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0029", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.016$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.41$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.41) * q, dxi/dt = (xi^2 - 0.016*xi) / 1.41, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.41, 0.016, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0030", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 8.0$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.0}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.0000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.0\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0031", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.69$, $\\sigma_1 = 0.208$, and $\\sigma_2 = 0.132$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04326 S_t^2 V_t + 0.03789 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.04326*S^2*V + 0.03789*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04326 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 84.32, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.69 * dW1 + np.sqrt(1 - 0.69**2) * dZ\ndS = 0.0462 * S0 * dt + 0.208 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.132 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0462*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.04326*S0**2*V0 + 0.03789*S0**2*np.sqrt(V0))*dt + 2*0.208*S0**2*V0*dW1 + 0.132*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0032", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.038$ and volatility $\\sigma = 0.176$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 98.3$ at maturity $T = 0.83$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 98.3, 0)$.", "ground_truth_answer": "dV/dt + 0.038*S*dV/dS + 0.5*0.03098*S^2*d2V/dS2 - 0.038*V = 0, V(S, 0.83) = max(S - 98.3, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 98.3, 0.038, 0.176, 0.83\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0033", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 2.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.43e-06$, temporary impact is $\\eta = 1.69e-05$, and trader risk aversion is $\\lambda = 1.31e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.31e-05 \\times 0.09}{1.69e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(2.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1.31e-05 * 0.09 / 1.69e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 2.4, 1.69e-05, 1.31e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0034", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 108.14$, paying a known discrete dividend $D = 2.30$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 95.44$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 108.14$, $D e^{-r t_D} = 2.2432$, and $K e^{-r T} = 90.7853$.\nTheoretical difference $C_0 - P_0 = 108.14 - 2.2432 - 90.7853 = 15.1115$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 15.1115)$.", "ground_truth_answer": "C0 - P0 = 15.1115, Lower bound = 15.1115", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 108.14, 95.44, 2.3, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 15.1115, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0035", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.043$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.79$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.79) * q, dxi/dt = (xi^2 - 0.043*xi) / 1.79, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.79, 0.043, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0036", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 3.3$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.3}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.8250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.3\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0037", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.41$, $\\sigma_1 = 0.288$, and $\\sigma_2 = 0.154$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.08294 S_t^2 V_t + -0.03637 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.08294*S^2*V + -0.03637*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.08294 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 130.11, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.41 * dW1 + np.sqrt(1 - -0.41**2) * dZ\ndS = 0.0788 * S0 * dt + 0.288 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.154 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0788*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.08294*S0**2*V0 + -0.03637*S0**2*np.sqrt(V0))*dt + 2*0.288*S0**2*V0*dW1 + 0.154*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0038", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.039$ and volatility $\\sigma = 0.28$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 108.1$ at maturity $T = 1.05$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 108.1, 0)$.", "ground_truth_answer": "dV/dt + 0.039*S*dV/dS + 0.5*0.07840*S^2*d2V/dS2 - 0.039*V = 0, V(S, 1.05) = max(S - 108.1, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 108.1, 0.039, 0.28, 1.05\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0039", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.34e-06$, temporary impact is $\\eta = 1.31e-05$, and trader risk aversion is $\\lambda = 6.99e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.99e-05 \\times 0.09}{1.31e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.99e-05 * 0.09 / 1.31e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.8, 1.31e-05, 6.99e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0040", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 92.96$, paying a known discrete dividend $D = 1.53$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 109.95$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 92.96$, $D e^{-r t_D} = 1.4922$, and $K e^{-r T} = 104.5877$.\nTheoretical difference $C_0 - P_0 = 92.96 - 1.4922 - 104.5877 = -13.1199$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -13.1199, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 92.96, 109.95, 1.53, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -13.1199, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0041", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.03$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.58$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.58) * q, dxi/dt = (xi^2 - 0.03*xi) / 0.58, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.58, 0.03, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0042", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 4.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.2000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0043", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.08$, $\\sigma_1 = 0.256$, and $\\sigma_2 = 0.19$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.06554 S_t^2 V_t + 0.00778 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.06554*S^2*V + 0.00778*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.06554 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 145.15, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.08 * dW1 + np.sqrt(1 - 0.08**2) * dZ\ndS = 0.0945 * S0 * dt + 0.256 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.19 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0945*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.06554*S0**2*V0 + 0.00778*S0**2*np.sqrt(V0))*dt + 2*0.256*S0**2*V0*dW1 + 0.19*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0044", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.06$ and volatility $\\sigma = 0.34$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 89.5$ at maturity $T = 1.59$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 89.5, 0)$.", "ground_truth_answer": "dV/dt + 0.06*S*dV/dS + 0.5*0.11560*S^2*d2V/dS2 - 0.06*V = 0, V(S, 1.59) = max(S - 89.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 89.5, 0.06, 0.34, 1.59\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0045", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 1.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.20e-06$, temporary impact is $\\eta = 3.20e-05$, and trader risk aversion is $\\lambda = 5.40e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.40e-05 \\times 0.09}{3.20e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(1.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.4e-05 * 0.09 / 3.2e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 1.4, 3.2e-05, 5.4e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0046", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 106.71$, paying a known discrete dividend $D = 1.37$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 96.42$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 106.71$, $D e^{-r t_D} = 1.3362$, and $K e^{-r T} = 91.7175$.\nTheoretical difference $C_0 - P_0 = 106.71 - 1.3362 - 91.7175 = 13.6563$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 13.6563)$.", "ground_truth_answer": "C0 - P0 = 13.6563, Lower bound = 13.6563", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 106.71, 96.42, 1.37, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 13.6563, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0047", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.044$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.99$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.99) * q, dxi/dt = (xi^2 - 0.044*xi) / 0.99, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.99, 0.044, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0048", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 7.7$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.7}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.9250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.7\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0049", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.16$, $\\sigma_1 = 0.169$, and $\\sigma_2 = 0.288$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.02856 S_t^2 V_t + -0.01558 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.02856*S^2*V + -0.01558*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.02856 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 171.43, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.16 * dW1 + np.sqrt(1 - -0.16**2) * dZ\ndS = 0.0679 * S0 * dt + 0.169 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.288 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0679*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.02856*S0**2*V0 + -0.01558*S0**2*np.sqrt(V0))*dt + 2*0.169*S0**2*V0*dW1 + 0.288*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0050", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.076$ and volatility $\\sigma = 0.184$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 93.6$ at maturity $T = 0.67$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 93.6, 0)$.", "ground_truth_answer": "dV/dt + 0.076*S*dV/dS + 0.5*0.03386*S^2*d2V/dS2 - 0.076*V = 0, V(S, 0.67) = max(S - 93.6, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 93.6, 0.076, 0.184, 0.67\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0051", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 1.7$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.75e-06$, temporary impact is $\\eta = 3.51e-05$, and trader risk aversion is $\\lambda = 2.36e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{2.36e-05 \\times 0.09}{3.51e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(1.7) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(2.36e-05 * 0.09 / 3.51e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 1.7, 3.51e-05, 2.36e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0052", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 109.64$, paying a known discrete dividend $D = 1.52$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 100.33$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 109.64$, $D e^{-r t_D} = 1.4825$, and $K e^{-r T} = 95.4368$.\nTheoretical difference $C_0 - P_0 = 109.64 - 1.4825 - 95.4368 = 12.7207$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 12.7207)$.", "ground_truth_answer": "C0 - P0 = 12.7207, Lower bound = 12.7207", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 109.64, 100.33, 1.52, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 12.7207, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0053", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.014$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.85$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.85) * q, dxi/dt = (xi^2 - 0.014*xi) / 1.85, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.85, 0.014, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0054", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 9.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.2750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0055", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.57$, $\\sigma_1 = 0.29$, and $\\sigma_2 = 0.269$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.2523 S_t^3 V_t + 0.1334 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.2523*S^3*V + 0.1334*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.2523 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 78.31, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.57 * dW1 + np.sqrt(1 - 0.57**2) * dZ\ndS = 0.0623 * S0 * dt + 0.29 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.269 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0623*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.2523*S0**3*V0 + 0.1334*S0**3*np.sqrt(V0))*dt + 3*0.29*S0**3*V0*dW1 + 0.269*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0056", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.067$ and volatility $\\sigma = 0.311$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 83.4$ at maturity $T = 0.74$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 83.4, 0)$.", "ground_truth_answer": "dV/dt + 0.067*S*dV/dS + 0.5*0.09672*S^2*d2V/dS2 - 0.067*V = 0, V(S, 0.74) = max(S - 83.4, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 83.4, 0.067, 0.311, 0.74\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0057", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 4.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.38e-06$, temporary impact is $\\eta = 2.95e-05$, and trader risk aversion is $\\lambda = 3.79e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.79e-05 \\times 0.09}{2.95e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(4.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.79e-05 * 0.09 / 2.95e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 4.8, 2.95e-05, 3.79e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0058", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 109.47$, paying a known discrete dividend $D = 1.61$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 95.68$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 109.47$, $D e^{-r t_D} = 1.5702$, and $K e^{-r T} = 91.0136$.\nTheoretical difference $C_0 - P_0 = 109.47 - 1.5702 - 91.0136 = 16.8862$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 16.8862)$.", "ground_truth_answer": "C0 - P0 = 16.8862, Lower bound = 16.8862", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 109.47, 95.68, 1.61, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 16.8862, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0059", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.038$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.48$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.48) * q, dxi/dt = (xi^2 - 0.038*xi) / 1.48, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.48, 0.038, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0060", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 3.4$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.4}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.8500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.4\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0061", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.39$, $\\sigma_1 = 0.186$, and $\\sigma_2 = 0.173$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0346 S_t^2 V_t + 0.0251 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0346*S^2*V + 0.0251*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0346 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 52.71, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.39 * dW1 + np.sqrt(1 - 0.39**2) * dZ\ndS = 0.0795 * S0 * dt + 0.186 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.173 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0795*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0346*S0**2*V0 + 0.0251*S0**2*np.sqrt(V0))*dt + 2*0.186*S0**2*V0*dW1 + 0.173*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0062", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.059$ and volatility $\\sigma = 0.292$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 83.7$ at maturity $T = 1.05$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 83.7, 0)$.", "ground_truth_answer": "dV/dt + 0.059*S*dV/dS + 0.5*0.08526*S^2*d2V/dS2 - 0.059*V = 0, V(S, 1.05) = max(S - 83.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 83.7, 0.059, 0.292, 1.05\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0063", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 2.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.33e-06$, temporary impact is $\\eta = 2.99e-05$, and trader risk aversion is $\\lambda = 9.79e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.79e-05 \\times 0.09}{2.99e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(2.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.79e-05 * 0.09 / 2.99e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 2.9, 2.99e-05, 9.79e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0064", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 108.12$, paying a known discrete dividend $D = 1.70$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 98.69$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 108.12$, $D e^{-r t_D} = 1.658$, and $K e^{-r T} = 93.8768$.\nTheoretical difference $C_0 - P_0 = 108.12 - 1.658 - 93.8768 = 12.5852$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 12.5852)$.", "ground_truth_answer": "C0 - P0 = 12.5852, Lower bound = 12.5852", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 108.12, 98.69, 1.7, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 12.5852, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0065", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.033$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.24$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.24) * q, dxi/dt = (xi^2 - 0.033*xi) / 1.24, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.24, 0.033, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0066", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 3.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.9500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0067", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.79$, $\\sigma_1 = 0.304$, and $\\sigma_2 = 0.109$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.27725 S_t^3 V_t + 0.07853 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.27725*S^3*V + 0.07853*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.27725 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 124.88, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.79 * dW1 + np.sqrt(1 - 0.79**2) * dZ\ndS = 0.0858 * S0 * dt + 0.304 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.109 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0858*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.27725*S0**3*V0 + 0.07853*S0**3*np.sqrt(V0))*dt + 3*0.304*S0**3*V0*dW1 + 0.109*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0068", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.077$ and volatility $\\sigma = 0.379$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 94.8$ at maturity $T = 0.52$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 94.8, 0)$.", "ground_truth_answer": "dV/dt + 0.077*S*dV/dS + 0.5*0.14364*S^2*d2V/dS2 - 0.077*V = 0, V(S, 0.52) = max(S - 94.8, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 94.8, 0.077, 0.379, 0.52\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0069", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 4.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.20e-06$, temporary impact is $\\eta = 4.84e-05$, and trader risk aversion is $\\lambda = 9.64e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.64e-05 \\times 0.09}{4.84e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(4.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.64e-05 * 0.09 / 4.84e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 4.4, 4.84e-05, 9.64e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0070", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 95.89$, paying a known discrete dividend $D = 2.70$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 97.70$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 95.89$, $D e^{-r t_D} = 2.6333$, and $K e^{-r T} = 92.9351$.\nTheoretical difference $C_0 - P_0 = 95.89 - 2.6333 - 92.9351 = 0.3216$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.3216)$.", "ground_truth_answer": "C0 - P0 = 0.3216, Lower bound = 0.3216", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 95.89, 97.7, 2.7, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 0.3216, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0071", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.017$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.34$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.34) * q, dxi/dt = (xi^2 - 0.017*xi) / 1.34, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.34, 0.017, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0072", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 8.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.2000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0073", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.23$, $\\sigma_1 = 0.192$, and $\\sigma_2 = 0.234$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.03686 S_t^2 V_t + -0.02067 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.03686*S^2*V + -0.02067*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.03686 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 189.5, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.23 * dW1 + np.sqrt(1 - -0.23**2) * dZ\ndS = 0.0456 * S0 * dt + 0.192 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.234 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0456*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.03686*S0**2*V0 + -0.02067*S0**2*np.sqrt(V0))*dt + 2*0.192*S0**2*V0*dW1 + 0.234*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0074", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.051$ and volatility $\\sigma = 0.369$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 109.6$ at maturity $T = 1.55$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 109.6, 0)$.", "ground_truth_answer": "dV/dt + 0.051*S*dV/dS + 0.5*0.13616*S^2*d2V/dS2 - 0.051*V = 0, V(S, 1.55) = max(S - 109.6, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 109.6, 0.051, 0.369, 1.55\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0075", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 2.7$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.57e-06$, temporary impact is $\\eta = 2.81e-05$, and trader risk aversion is $\\lambda = 3.04e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.04e-05 \\times 0.09}{2.81e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(2.7) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.04e-05 * 0.09 / 2.81e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 2.7, 2.81e-05, 3.04e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0076", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 95.12$, paying a known discrete dividend $D = 1.16$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 102.23$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 95.12$, $D e^{-r t_D} = 1.1314$, and $K e^{-r T} = 97.2442$.\nTheoretical difference $C_0 - P_0 = 95.12 - 1.1314 - 97.2442 = -3.2556$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -3.2556, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 95.12, 102.23, 1.16, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -3.2556, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0077", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.03$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.7$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.7) * q, dxi/dt = (xi^2 - 0.03*xi) / 1.7, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.7, 0.03, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0078", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 2.6$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{2.6}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.6500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 2.6\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0079", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.13$, $\\sigma_1 = 0.327$, and $\\sigma_2 = 0.106$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.32079 S_t^3 V_t + 0.01352 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.32079*S^3*V + 0.01352*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.32079 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 109.52, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.13 * dW1 + np.sqrt(1 - 0.13**2) * dZ\ndS = 0.0441 * S0 * dt + 0.327 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.106 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0441*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.32079*S0**3*V0 + 0.01352*S0**3*np.sqrt(V0))*dt + 3*0.327*S0**3*V0*dW1 + 0.106*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0080", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.055$ and volatility $\\sigma = 0.159$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 98.6$ at maturity $T = 1.31$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 98.6, 0)$.", "ground_truth_answer": "dV/dt + 0.055*S*dV/dS + 0.5*0.02528*S^2*d2V/dS2 - 0.055*V = 0, V(S, 1.31) = max(S - 98.6, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 98.6, 0.055, 0.159, 1.31\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0081", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 1.2$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.21e-06$, temporary impact is $\\eta = 4.32e-05$, and trader risk aversion is $\\lambda = 2.58e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{2.58e-05 \\times 0.09}{4.32e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(1.2) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(2.58e-05 * 0.09 / 4.32e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 1.2, 4.32e-05, 2.58e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0082", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 96.07$, paying a known discrete dividend $D = 1.65$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 100.74$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 96.07$, $D e^{-r t_D} = 1.6093$, and $K e^{-r T} = 95.8269$.\nTheoretical difference $C_0 - P_0 = 96.07 - 1.6093 - 95.8269 = -1.3662$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -1.3662, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 96.07, 100.74, 1.65, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -1.3662, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0083", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.021$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.95$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.95) * q, dxi/dt = (xi^2 - 0.021*xi) / 1.95, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.95, 0.021, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0084", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 2.7$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{2.7}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.6750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 2.7\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0085", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.36$, $\\sigma_1 = 0.258$, and $\\sigma_2 = 0.227$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.06656 S_t^2 V_t + 0.04217 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.06656*S^2*V + 0.04217*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.06656 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 57.75, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.36 * dW1 + np.sqrt(1 - 0.36**2) * dZ\ndS = 0.0825 * S0 * dt + 0.258 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.227 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0825*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.06656*S0**2*V0 + 0.04217*S0**2*np.sqrt(V0))*dt + 2*0.258*S0**2*V0*dW1 + 0.227*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0086", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.078$ and volatility $\\sigma = 0.329$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 81.6$ at maturity $T = 1.1$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 81.6, 0)$.", "ground_truth_answer": "dV/dt + 0.078*S*dV/dS + 0.5*0.10824*S^2*d2V/dS2 - 0.078*V = 0, V(S, 1.1) = max(S - 81.6, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 81.6, 0.078, 0.329, 1.1\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0087", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 4.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.25e-06$, temporary impact is $\\eta = 4.80e-06$, and trader risk aversion is $\\lambda = 3.50e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.50e-06 \\times 0.09}{4.80e-06}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(4.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.5e-06 * 0.09 / 4.8e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 4.9, 4.8e-06, 3.5e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0088", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 106.72$, paying a known discrete dividend $D = 1.82$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 103.92$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 106.72$, $D e^{-r t_D} = 1.7751$, and $K e^{-r T} = 98.8518$.\nTheoretical difference $C_0 - P_0 = 106.72 - 1.7751 - 98.8518 = 6.0931$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 6.0931)$.", "ground_truth_answer": "C0 - P0 = 6.0931, Lower bound = 6.0931", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 106.72, 103.92, 1.82, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 6.0931, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0089", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.047$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.16$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.16) * q, dxi/dt = (xi^2 - 0.047*xi) / 1.16, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.16, 0.047, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0090", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 2.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{2.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.7000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 2.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0091", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.25$, $\\sigma_1 = 0.278$, and $\\sigma_2 = 0.203$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.07728 S_t^2 V_t + 0.02822 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.07728*S^2*V + 0.02822*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.07728 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 77.43, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.25 * dW1 + np.sqrt(1 - 0.25**2) * dZ\ndS = 0.1148 * S0 * dt + 0.278 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.203 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1148*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.07728*S0**2*V0 + 0.02822*S0**2*np.sqrt(V0))*dt + 2*0.278*S0**2*V0*dW1 + 0.203*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0092", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.057$ and volatility $\\sigma = 0.255$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 89.9$ at maturity $T = 1.03$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 89.9, 0)$.", "ground_truth_answer": "dV/dt + 0.057*S*dV/dS + 0.5*0.06502*S^2*d2V/dS2 - 0.057*V = 0, V(S, 1.03) = max(S - 89.9, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 89.9, 0.057, 0.255, 1.03\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0093", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 1.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 6.90e-07$, temporary impact is $\\eta = 1.78e-05$, and trader risk aversion is $\\lambda = 1.01e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.01e-05 \\times 0.09}{1.78e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(1.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1.01e-05 * 0.09 / 1.78e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 1.4, 1.78e-05, 1.01e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0094", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 96.23$, paying a known discrete dividend $D = 1.35$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 109.59$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 96.23$, $D e^{-r t_D} = 1.3167$, and $K e^{-r T} = 104.2452$.\nTheoretical difference $C_0 - P_0 = 96.23 - 1.3167 - 104.2452 = -9.3319$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -9.3319, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 96.23, 109.59, 1.35, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -9.3319, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0095", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.041$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.71$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.71) * q, dxi/dt = (xi^2 - 0.041*xi) / 1.71, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.71, 0.041, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0096", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 5.7$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.7}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.4250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.7\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0097", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.38$, $\\sigma_1 = 0.34$, and $\\sigma_2 = 0.277$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.3468 S_t^3 V_t + -0.10737 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.3468*S^3*V + -0.10737*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.3468 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 147.47, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.38 * dW1 + np.sqrt(1 - -0.38**2) * dZ\ndS = 0.0438 * S0 * dt + 0.34 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.277 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0438*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.3468*S0**3*V0 + -0.10737*S0**3*np.sqrt(V0))*dt + 3*0.34*S0**3*V0*dW1 + 0.277*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0098", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.058$ and volatility $\\sigma = 0.276$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 114.3$ at maturity $T = 1.49$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 114.3, 0)$.", "ground_truth_answer": "dV/dt + 0.058*S*dV/dS + 0.5*0.07618*S^2*d2V/dS2 - 0.058*V = 0, V(S, 1.49) = max(S - 114.3, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 114.3, 0.058, 0.276, 1.49\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0099", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 4.2$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.73e-06$, temporary impact is $\\eta = 4.35e-05$, and trader risk aversion is $\\lambda = 6.40e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.40e-05 \\times 0.09}{4.35e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(4.2) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.4e-05 * 0.09 / 4.35e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 4.2, 4.35e-05, 6.4e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0100", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 103.54$, paying a known discrete dividend $D = 1.26$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 101.47$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 103.54$, $D e^{-r t_D} = 1.2289$, and $K e^{-r T} = 96.5212$.\nTheoretical difference $C_0 - P_0 = 103.54 - 1.2289 - 96.5212 = 5.7899$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 5.7899)$.", "ground_truth_answer": "C0 - P0 = 5.7899, Lower bound = 5.7899", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 103.54, 101.47, 1.26, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 5.7899, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0101", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.032$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.91$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.91) * q, dxi/dt = (xi^2 - 0.032*xi) / 1.91, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.91, 0.032, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0102", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 8.6$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.6}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.1500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.6\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0103", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.2$, $\\sigma_1 = 0.205$, and $\\sigma_2 = 0.143$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04202 S_t^2 V_t + -0.01173 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.04202*S^2*V + -0.01173*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04202 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 147.72, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.2 * dW1 + np.sqrt(1 - -0.2**2) * dZ\ndS = 0.0565 * S0 * dt + 0.205 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.143 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0565*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.04202*S0**2*V0 + -0.01173*S0**2*np.sqrt(V0))*dt + 2*0.205*S0**2*V0*dW1 + 0.143*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0104", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.026$ and volatility $\\sigma = 0.321$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 82.8$ at maturity $T = 0.98$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 82.8, 0)$.", "ground_truth_answer": "dV/dt + 0.026*S*dV/dS + 0.5*0.10304*S^2*d2V/dS2 - 0.026*V = 0, V(S, 0.98) = max(S - 82.8, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 82.8, 0.026, 0.321, 0.98\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0105", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 3.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.44e-06$, temporary impact is $\\eta = 1.77e-05$, and trader risk aversion is $\\lambda = 2.68e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{2.68e-05 \\times 0.09}{1.77e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(3.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(2.68e-05 * 0.09 / 1.77e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 3.0, 1.77e-05, 2.68e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0106", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 103.86$, paying a known discrete dividend $D = 2.87$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 96.97$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 103.86$, $D e^{-r t_D} = 2.7991$, and $K e^{-r T} = 92.2407$.\nTheoretical difference $C_0 - P_0 = 103.86 - 2.7991 - 92.2407 = 8.8202$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 8.8202)$.", "ground_truth_answer": "C0 - P0 = 8.8202, Lower bound = 8.8202", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 103.86, 96.97, 2.87, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 8.8202, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0107", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.042$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.92$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.92) * q, dxi/dt = (xi^2 - 0.042*xi) / 0.92, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.92, 0.042, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0108", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 5.4$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.4}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.3500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.4\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0109", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.4$, $\\sigma_1 = 0.296$, and $\\sigma_2 = 0.126$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.26285 S_t^3 V_t + -0.04476 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.26285*S^3*V + -0.04476*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.26285 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 135.28, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.4 * dW1 + np.sqrt(1 - -0.4**2) * dZ\ndS = 0.0861 * S0 * dt + 0.296 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.126 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0861*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.26285*S0**3*V0 + -0.04476*S0**3*np.sqrt(V0))*dt + 3*0.296*S0**3*V0*dW1 + 0.126*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0110", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.04$ and volatility $\\sigma = 0.383$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 114.3$ at maturity $T = 1.14$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 114.3, 0)$.", "ground_truth_answer": "dV/dt + 0.04*S*dV/dS + 0.5*0.14669*S^2*d2V/dS2 - 0.04*V = 0, V(S, 1.14) = max(S - 114.3, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 114.3, 0.04, 0.383, 1.14\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0111", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.1$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.73e-06$, temporary impact is $\\eta = 1.27e-05$, and trader risk aversion is $\\lambda = 3.84e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.84e-05 \\times 0.09}{1.27e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.1) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.84e-05 * 0.09 / 1.27e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.1, 1.27e-05, 3.84e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0112", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 99.93$, paying a known discrete dividend $D = 1.60$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 97.79$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 99.93$, $D e^{-r t_D} = 1.5605$, and $K e^{-r T} = 93.0207$.\nTheoretical difference $C_0 - P_0 = 99.93 - 1.5605 - 93.0207 = 5.3488$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 5.3488)$.", "ground_truth_answer": "C0 - P0 = 5.3488, Lower bound = 5.3488", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 99.93, 97.79, 1.6, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 5.3488, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0113", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.026$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.52$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.52) * q, dxi/dt = (xi^2 - 0.026*xi) / 0.52, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.52, 0.026, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0114", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 8.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.2000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0115", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.01$, $\\sigma_1 = 0.285$, and $\\sigma_2 = 0.197$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.24367 S_t^3 V_t + -0.00168 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.24367*S^3*V + -0.00168*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.24367 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 103.24, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.01 * dW1 + np.sqrt(1 - -0.01**2) * dZ\ndS = 0.1165 * S0 * dt + 0.285 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.197 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.1165*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.24367*S0**3*V0 + -0.00168*S0**3*np.sqrt(V0))*dt + 3*0.285*S0**3*V0*dW1 + 0.197*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0116", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.047$ and volatility $\\sigma = 0.223$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 93.1$ at maturity $T = 1.51$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 93.1, 0)$.", "ground_truth_answer": "dV/dt + 0.047*S*dV/dS + 0.5*0.04973*S^2*d2V/dS2 - 0.047*V = 0, V(S, 1.51) = max(S - 93.1, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 93.1, 0.047, 0.223, 1.51\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0117", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.98e-06$, temporary impact is $\\eta = 3.97e-05$, and trader risk aversion is $\\lambda = 1.00e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.00e-05 \\times 0.09}{3.97e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1e-05 * 0.09 / 3.97e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.0, 3.97e-05, 1e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0118", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 91.15$, paying a known discrete dividend $D = 1.88$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 100.99$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 91.15$, $D e^{-r t_D} = 1.8336$, and $K e^{-r T} = 96.0647$.\nTheoretical difference $C_0 - P_0 = 91.15 - 1.8336 - 96.0647 = -6.7483$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -6.7483, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 91.15, 100.99, 1.88, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -6.7483, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0119", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.032$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.56$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.56) * q, dxi/dt = (xi^2 - 0.032*xi) / 1.56, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.56, 0.032, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0120", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 3.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.7750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0121", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.32$, $\\sigma_1 = 0.17$, and $\\sigma_2 = 0.117$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.0867 S_t^3 V_t + 0.01909 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.0867*S^3*V + 0.01909*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.0867 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 164.23, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.32 * dW1 + np.sqrt(1 - 0.32**2) * dZ\ndS = 0.0895 * S0 * dt + 0.17 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.117 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0895*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.0867*S0**3*V0 + 0.01909*S0**3*np.sqrt(V0))*dt + 3*0.17*S0**3*V0*dW1 + 0.117*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0122", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.044$ and volatility $\\sigma = 0.373$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 85.9$ at maturity $T = 1.27$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 85.9, 0)$.", "ground_truth_answer": "dV/dt + 0.044*S*dV/dS + 0.5*0.13913*S^2*d2V/dS2 - 0.044*V = 0, V(S, 1.27) = max(S - 85.9, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 85.9, 0.044, 0.373, 1.27\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0123", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 4.3$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.93e-06$, temporary impact is $\\eta = 1.93e-05$, and trader risk aversion is $\\lambda = 3.77e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.77e-05 \\times 0.09}{1.93e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(4.3) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.77e-05 * 0.09 / 1.93e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 4.3, 1.93e-05, 3.77e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0124", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 108.94$, paying a known discrete dividend $D = 2.51$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 109.72$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 108.94$, $D e^{-r t_D} = 2.448$, and $K e^{-r T} = 104.3689$.\nTheoretical difference $C_0 - P_0 = 108.94 - 2.448 - 104.3689 = 2.1231$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 2.1231)$.", "ground_truth_answer": "C0 - P0 = 2.1231, Lower bound = 2.1231", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 108.94, 109.72, 2.51, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 2.1231, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0125", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.038$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.22$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.22) * q, dxi/dt = (xi^2 - 0.038*xi) / 1.22, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.22, 0.038, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0126", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 7.6$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.6}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.9000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.6\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0127", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.15$, $\\sigma_1 = 0.237$, and $\\sigma_2 = 0.151$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.16851 S_t^3 V_t + -0.0161 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.16851*S^3*V + -0.0161*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.16851 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 87.31, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.15 * dW1 + np.sqrt(1 - -0.15**2) * dZ\ndS = 0.0664 * S0 * dt + 0.237 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.151 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0664*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.16851*S0**3*V0 + -0.0161*S0**3*np.sqrt(V0))*dt + 3*0.237*S0**3*V0*dW1 + 0.151*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0128", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.023$ and volatility $\\sigma = 0.18$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 84.7$ at maturity $T = 1.47$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 84.7, 0)$.", "ground_truth_answer": "dV/dt + 0.023*S*dV/dS + 0.5*0.03240*S^2*d2V/dS2 - 0.023*V = 0, V(S, 1.47) = max(S - 84.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 84.7, 0.023, 0.18, 1.47\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0129", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 2.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.44e-06$, temporary impact is $\\eta = 1.26e-05$, and trader risk aversion is $\\lambda = 4.06e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{4.06e-05 \\times 0.09}{1.26e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(2.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(4.06e-05 * 0.09 / 1.26e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 2.9, 1.26e-05, 4.06e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0130", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 91.66$, paying a known discrete dividend $D = 1.87$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 100.57$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 91.66$, $D e^{-r t_D} = 1.8238$, and $K e^{-r T} = 95.6651$.\nTheoretical difference $C_0 - P_0 = 91.66 - 1.8238 - 95.6651 = -5.8289$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -5.8289, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 91.66, 100.57, 1.87, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -5.8289, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0131", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.01$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.95$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.95) * q, dxi/dt = (xi^2 - 0.01*xi) / 1.95, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.95, 0.01, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0132", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 4.6$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.6}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.1500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.6\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0133", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.31$, $\\sigma_1 = 0.334$, and $\\sigma_2 = 0.151$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.11156 S_t^2 V_t + 0.03127 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.11156*S^2*V + 0.03127*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.11156 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 56.51, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.31 * dW1 + np.sqrt(1 - 0.31**2) * dZ\ndS = 0.114 * S0 * dt + 0.334 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.151 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.114*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.11156*S0**2*V0 + 0.03127*S0**2*np.sqrt(V0))*dt + 2*0.334*S0**2*V0*dW1 + 0.151*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0134", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.051$ and volatility $\\sigma = 0.307$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 107.8$ at maturity $T = 1.18$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 107.8, 0)$.", "ground_truth_answer": "dV/dt + 0.051*S*dV/dS + 0.5*0.09425*S^2*d2V/dS2 - 0.051*V = 0, V(S, 1.18) = max(S - 107.8, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 107.8, 0.051, 0.307, 1.18\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0135", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 4.7$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.51e-06$, temporary impact is $\\eta = 1.98e-05$, and trader risk aversion is $\\lambda = 7.40e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.40e-05 \\times 0.09}{1.98e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(4.7) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.4e-05 * 0.09 / 1.98e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 4.7, 1.98e-05, 7.4e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0136", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 109.17$, paying a known discrete dividend $D = 1.79$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 91.16$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 109.17$, $D e^{-r t_D} = 1.7458$, and $K e^{-r T} = 86.7141$.\nTheoretical difference $C_0 - P_0 = 109.17 - 1.7458 - 86.7141 = 20.7101$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 20.7101)$.", "ground_truth_answer": "C0 - P0 = 20.7101, Lower bound = 20.7101", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 109.17, 91.16, 1.79, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 20.7101, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0137", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.021$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.78$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.78) * q, dxi/dt = (xi^2 - 0.021*xi) / 0.78, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.78, 0.021, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0138", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 5.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.2750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0139", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.07$, $\\sigma_1 = 0.222$, and $\\sigma_2 = 0.152$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04928 S_t^2 V_t + -0.00472 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.04928*S^2*V + -0.00472*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04928 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 84.41, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.07 * dW1 + np.sqrt(1 - -0.07**2) * dZ\ndS = 0.0613 * S0 * dt + 0.222 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.152 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0613*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.04928*S0**2*V0 + -0.00472*S0**2*np.sqrt(V0))*dt + 2*0.222*S0**2*V0*dW1 + 0.152*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0140", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.052$ and volatility $\\sigma = 0.227$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 112.6$ at maturity $T = 1.53$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 112.6, 0)$.", "ground_truth_answer": "dV/dt + 0.052*S*dV/dS + 0.5*0.05153*S^2*d2V/dS2 - 0.052*V = 0, V(S, 1.53) = max(S - 112.6, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 112.6, 0.052, 0.227, 1.53\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0141", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 2.7$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 7.50e-07$, temporary impact is $\\eta = 4.70e-06$, and trader risk aversion is $\\lambda = 9.41e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.41e-05 \\times 0.09}{4.70e-06}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(2.7) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.41e-05 * 0.09 / 4.7e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 2.7, 4.7e-06, 9.41e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0142", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 101.62$, paying a known discrete dividend $D = 1.17$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 108.38$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 101.62$, $D e^{-r t_D} = 1.1411$, and $K e^{-r T} = 103.0942$.\nTheoretical difference $C_0 - P_0 = 101.62 - 1.1411 - 103.0942 = -2.6153$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -2.6153, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 101.62, 108.38, 1.17, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -2.6153, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0143", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.045$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.57$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.57) * q, dxi/dt = (xi^2 - 0.045*xi) / 0.57, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.57, 0.045, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0144", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 5.3$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.3}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.3250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.3\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0145", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.4$, $\\sigma_1 = 0.347$, and $\\sigma_2 = 0.175$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.12041 S_t^2 V_t + 0.04858 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.12041*S^2*V + 0.04858*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.12041 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 166.64, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.4 * dW1 + np.sqrt(1 - 0.4**2) * dZ\ndS = 0.0784 * S0 * dt + 0.347 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.175 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0784*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.12041*S0**2*V0 + 0.04858*S0**2*np.sqrt(V0))*dt + 2*0.347*S0**2*V0*dW1 + 0.175*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0146", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.078$ and volatility $\\sigma = 0.361$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 113.5$ at maturity $T = 1.2$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 113.5, 0)$.", "ground_truth_answer": "dV/dt + 0.078*S*dV/dS + 0.5*0.13032*S^2*d2V/dS2 - 0.078*V = 0, V(S, 1.2) = max(S - 113.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 113.5, 0.078, 0.361, 1.2\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0147", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 3.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 7.60e-07$, temporary impact is $\\eta = 1.70e-06$, and trader risk aversion is $\\lambda = 8.50e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{8.50e-06 \\times 0.09}{1.70e-06}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(3.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(8.5e-06 * 0.09 / 1.7e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 3.8, 1.7e-06, 8.5e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0148", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 100.69$, paying a known discrete dividend $D = 2.83$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 105.00$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 100.69$, $D e^{-r t_D} = 2.7601$, and $K e^{-r T} = 99.8791$.\nTheoretical difference $C_0 - P_0 = 100.69 - 2.7601 - 99.8791 = -1.9492$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -1.9492, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 100.69, 105.0, 2.83, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -1.9492, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0149", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.041$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.92$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.92) * q, dxi/dt = (xi^2 - 0.041*xi) / 1.92, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.92, 0.041, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0150", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 5.0$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.0}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.2500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.0\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0151", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.47$, $\\sigma_1 = 0.2$, and $\\sigma_2 = 0.155$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04 S_t^2 V_t + -0.02914 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.04*S^2*V + -0.02914*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 86.16, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.47 * dW1 + np.sqrt(1 - -0.47**2) * dZ\ndS = 0.0564 * S0 * dt + 0.2 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.155 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0564*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.04*S0**2*V0 + -0.02914*S0**2*np.sqrt(V0))*dt + 2*0.2*S0**2*V0*dW1 + 0.155*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0152", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.06$ and volatility $\\sigma = 0.305$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 94.3$ at maturity $T = 0.67$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 94.3, 0)$.", "ground_truth_answer": "dV/dt + 0.06*S*dV/dS + 0.5*0.09302*S^2*d2V/dS2 - 0.06*V = 0, V(S, 0.67) = max(S - 94.3, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 94.3, 0.06, 0.305, 0.67\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0153", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 2.2$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.54e-06$, temporary impact is $\\eta = 2.43e-05$, and trader risk aversion is $\\lambda = 8.33e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{8.33e-05 \\times 0.09}{2.43e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(2.2) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(8.33e-05 * 0.09 / 2.43e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 2.2, 2.43e-05, 8.33e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0154", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 106.33$, paying a known discrete dividend $D = 1.18$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 109.36$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 106.33$, $D e^{-r t_D} = 1.1509$, and $K e^{-r T} = 104.0264$.\nTheoretical difference $C_0 - P_0 = 106.33 - 1.1509 - 104.0264 = 1.1527$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 1.1527)$.", "ground_truth_answer": "C0 - P0 = 1.1527, Lower bound = 1.1527", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 106.33, 109.36, 1.18, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 1.1527, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0155", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.026$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.7$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.7) * q, dxi/dt = (xi^2 - 0.026*xi) / 0.7, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.7, 0.026, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0156", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 5.4$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.4}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.3500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.4\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0157", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.19$, $\\sigma_1 = 0.311$, and $\\sigma_2 = 0.281$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.29016 S_t^3 V_t + 0.04981 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.29016*S^3*V + 0.04981*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.29016 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 167.7, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.19 * dW1 + np.sqrt(1 - 0.19**2) * dZ\ndS = 0.0911 * S0 * dt + 0.311 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.281 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0911*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.29016*S0**3*V0 + 0.04981*S0**3*np.sqrt(V0))*dt + 3*0.311*S0**3*V0*dW1 + 0.281*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0158", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.041$ and volatility $\\sigma = 0.297$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 95.7$ at maturity $T = 1.16$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 95.7, 0)$.", "ground_truth_answer": "dV/dt + 0.041*S*dV/dS + 0.5*0.08821*S^2*d2V/dS2 - 0.041*V = 0, V(S, 1.16) = max(S - 95.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 95.7, 0.041, 0.297, 1.16\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0159", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 4.6$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.66e-06$, temporary impact is $\\eta = 2.78e-05$, and trader risk aversion is $\\lambda = 4.56e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{4.56e-05 \\times 0.09}{2.78e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(4.6) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(4.56e-05 * 0.09 / 2.78e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 4.6, 2.78e-05, 4.56e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0160", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 95.96$, paying a known discrete dividend $D = 2.40$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 100.47$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 95.96$, $D e^{-r t_D} = 2.3407$, and $K e^{-r T} = 95.57$.\nTheoretical difference $C_0 - P_0 = 95.96 - 2.3407 - 95.57 = -1.9507$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -1.9507, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 95.96, 100.47, 2.4, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -1.9507, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0161", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.016$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.89$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.89) * q, dxi/dt = (xi^2 - 0.016*xi) / 1.89, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.89, 0.016, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0162", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 8.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.0500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0163", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.47$, $\\sigma_1 = 0.274$, and $\\sigma_2 = 0.169$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.07508 S_t^2 V_t + -0.04353 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.07508*S^2*V + -0.04353*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.07508 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 59.94, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.47 * dW1 + np.sqrt(1 - -0.47**2) * dZ\ndS = 0.0437 * S0 * dt + 0.274 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.169 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0437*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.07508*S0**2*V0 + -0.04353*S0**2*np.sqrt(V0))*dt + 2*0.274*S0**2*V0*dW1 + 0.169*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0164", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.034$ and volatility $\\sigma = 0.169$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 85.2$ at maturity $T = 0.69$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 85.2, 0)$.", "ground_truth_answer": "dV/dt + 0.034*S*dV/dS + 0.5*0.02856*S^2*d2V/dS2 - 0.034*V = 0, V(S, 0.69) = max(S - 85.2, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 85.2, 0.034, 0.169, 0.69\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0165", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 3.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.06e-06$, temporary impact is $\\eta = 3.52e-05$, and trader risk aversion is $\\lambda = 1.88e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.88e-05 \\times 0.09}{3.52e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(3.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1.88e-05 * 0.09 / 3.52e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 3.8, 3.52e-05, 1.88e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0166", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 98.23$, paying a known discrete dividend $D = 2.03$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 107.49$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 98.23$, $D e^{-r t_D} = 1.9799$, and $K e^{-r T} = 102.2477$.\nTheoretical difference $C_0 - P_0 = 98.23 - 1.9799 - 102.2477 = -5.9976$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -5.9976, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 98.23, 107.49, 2.03, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -5.9976, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0167", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.034$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.84$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.84) * q, dxi/dt = (xi^2 - 0.034*xi) / 0.84, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.84, 0.034, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0168", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 3.4$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.4}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.8500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.4\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0169", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.06$, $\\sigma_1 = 0.168$, and $\\sigma_2 = 0.124$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.08467 S_t^3 V_t + -0.00375 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.08467*S^3*V + -0.00375*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.08467 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 91.79, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.06 * dW1 + np.sqrt(1 - -0.06**2) * dZ\ndS = 0.0542 * S0 * dt + 0.168 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.124 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0542*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.08467*S0**3*V0 + -0.00375*S0**3*np.sqrt(V0))*dt + 3*0.168*S0**3*V0*dW1 + 0.124*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0170", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.074$ and volatility $\\sigma = 0.182$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 93.2$ at maturity $T = 0.98$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 93.2, 0)$.", "ground_truth_answer": "dV/dt + 0.074*S*dV/dS + 0.5*0.03312*S^2*d2V/dS2 - 0.074*V = 0, V(S, 0.98) = max(S - 93.2, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 93.2, 0.074, 0.182, 0.98\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0171", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 4.5$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.02e-06$, temporary impact is $\\eta = 3.18e-05$, and trader risk aversion is $\\lambda = 9.10e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.10e-06 \\times 0.09}{3.18e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(4.5) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.1e-06 * 0.09 / 3.18e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 4.5, 3.18e-05, 9.1e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0172", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 108.42$, paying a known discrete dividend $D = 1.55$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 91.22$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 108.42$, $D e^{-r t_D} = 1.5117$, and $K e^{-r T} = 86.7711$.\nTheoretical difference $C_0 - P_0 = 108.42 - 1.5117 - 86.7711 = 20.1372$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 20.1372)$.", "ground_truth_answer": "C0 - P0 = 20.1372, Lower bound = 20.1372", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 108.42, 91.22, 1.55, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 20.1372, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0173", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.013$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.4$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.4) * q, dxi/dt = (xi^2 - 0.013*xi) / 1.4, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.4, 0.013, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0174", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 6.3$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.3}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.5750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.3\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0175", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.35$, $\\sigma_1 = 0.302$, and $\\sigma_2 = 0.206$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.27361 S_t^3 V_t + 0.06532 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.27361*S^3*V + 0.06532*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.27361 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 188.61, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.35 * dW1 + np.sqrt(1 - 0.35**2) * dZ\ndS = 0.0589 * S0 * dt + 0.302 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.206 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0589*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.27361*S0**3*V0 + 0.06532*S0**3*np.sqrt(V0))*dt + 3*0.302*S0**3*V0*dW1 + 0.206*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0176", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.022$ and volatility $\\sigma = 0.213$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 108.5$ at maturity $T = 1.84$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 108.5, 0)$.", "ground_truth_answer": "dV/dt + 0.022*S*dV/dS + 0.5*0.04537*S^2*d2V/dS2 - 0.022*V = 0, V(S, 1.84) = max(S - 108.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 108.5, 0.022, 0.213, 1.84\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0177", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 2.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.77e-06$, temporary impact is $\\eta = 2.50e-06$, and trader risk aversion is $\\lambda = 8.69e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{8.69e-05 \\times 0.09}{2.50e-06}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(2.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(8.69e-05 * 0.09 / 2.5e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 2.4, 2.5e-06, 8.69e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0178", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 97.94$, paying a known discrete dividend $D = 2.47$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 92.10$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 97.94$, $D e^{-r t_D} = 2.409$, and $K e^{-r T} = 87.6082$.\nTheoretical difference $C_0 - P_0 = 97.94 - 2.409 - 87.6082 = 7.9228$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 7.9228)$.", "ground_truth_answer": "C0 - P0 = 7.9228, Lower bound = 7.9228", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 97.94, 92.1, 2.47, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 7.9228, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0179", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.033$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.76$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.76) * q, dxi/dt = (xi^2 - 0.033*xi) / 1.76, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.76, 0.033, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0180", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 4.6$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.6}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.1500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.6\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0181", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.46$, $\\sigma_1 = 0.269$, and $\\sigma_2 = 0.236$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.07236 S_t^2 V_t + 0.05841 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.07236*S^2*V + 0.05841*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.07236 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 67.96, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.46 * dW1 + np.sqrt(1 - 0.46**2) * dZ\ndS = 0.1112 * S0 * dt + 0.269 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.236 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1112*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.07236*S0**2*V0 + 0.05841*S0**2*np.sqrt(V0))*dt + 2*0.269*S0**2*V0*dW1 + 0.236*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0182", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.049$ and volatility $\\sigma = 0.296$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 109.5$ at maturity $T = 1.34$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 109.5, 0)$.", "ground_truth_answer": "dV/dt + 0.049*S*dV/dS + 0.5*0.08762*S^2*d2V/dS2 - 0.049*V = 0, V(S, 1.34) = max(S - 109.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 109.5, 0.049, 0.296, 1.34\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0183", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 4.6$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.87e-06$, temporary impact is $\\eta = 1.96e-05$, and trader risk aversion is $\\lambda = 3.44e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.44e-05 \\times 0.09}{1.96e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(4.6) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.44e-05 * 0.09 / 1.96e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 4.6, 1.96e-05, 3.44e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0184", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 102.15$, paying a known discrete dividend $D = 2.00$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 94.89$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 102.15$, $D e^{-r t_D} = 1.9506$, and $K e^{-r T} = 90.2622$.\nTheoretical difference $C_0 - P_0 = 102.15 - 1.9506 - 90.2622 = 9.9372$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 9.9372)$.", "ground_truth_answer": "C0 - P0 = 9.9372, Lower bound = 9.9372", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 102.15, 94.89, 2.0, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 9.9372, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0185", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.034$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.86$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.86) * q, dxi/dt = (xi^2 - 0.034*xi) / 0.86, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.86, 0.034, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0186", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 3.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.9500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0187", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.49$, $\\sigma_1 = 0.32$, and $\\sigma_2 = 0.118$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.3072 S_t^3 V_t + 0.05551 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.3072*S^3*V + 0.05551*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.3072 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 104.8, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.49 * dW1 + np.sqrt(1 - 0.49**2) * dZ\ndS = 0.079 * S0 * dt + 0.32 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.118 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.079*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.3072*S0**3*V0 + 0.05551*S0**3*np.sqrt(V0))*dt + 3*0.32*S0**3*V0*dW1 + 0.118*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0188", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.074$ and volatility $\\sigma = 0.17$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 101.0$ at maturity $T = 1.12$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 101.0, 0)$.", "ground_truth_answer": "dV/dt + 0.074*S*dV/dS + 0.5*0.02890*S^2*d2V/dS2 - 0.074*V = 0, V(S, 1.12) = max(S - 101.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 101.0, 0.074, 0.17, 1.12\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0189", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 1.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.49e-06$, temporary impact is $\\eta = 2.92e-05$, and trader risk aversion is $\\lambda = 9.18e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.18e-05 \\times 0.09}{2.92e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(1.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.18e-05 * 0.09 / 2.92e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 1.0, 2.92e-05, 9.18e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0190", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 109.50$, paying a known discrete dividend $D = 2.45$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 99.81$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 109.5$, $D e^{-r t_D} = 2.3895$, and $K e^{-r T} = 94.9422$.\nTheoretical difference $C_0 - P_0 = 109.5 - 2.3895 - 94.9422 = 12.1683$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 12.1683)$.", "ground_truth_answer": "C0 - P0 = 12.1683, Lower bound = 12.1683", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 109.5, 99.81, 2.45, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 12.1683, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0191", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.047$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.34$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.34) * q, dxi/dt = (xi^2 - 0.047*xi) / 1.34, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.34, 0.047, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0192", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 4.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.0500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0193", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.01$, $\\sigma_1 = 0.215$, and $\\sigma_2 = 0.185$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04622 S_t^2 V_t + 0.0008 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.04622*S^2*V + 0.0008*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04622 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 165.42, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.01 * dW1 + np.sqrt(1 - 0.01**2) * dZ\ndS = 0.055 * S0 * dt + 0.215 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.185 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.055*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.04622*S0**2*V0 + 0.0008*S0**2*np.sqrt(V0))*dt + 2*0.215*S0**2*V0*dW1 + 0.185*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0194", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.052$ and volatility $\\sigma = 0.327$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 110.7$ at maturity $T = 0.63$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 110.7, 0)$.", "ground_truth_answer": "dV/dt + 0.052*S*dV/dS + 0.5*0.10693*S^2*d2V/dS2 - 0.052*V = 0, V(S, 0.63) = max(S - 110.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 110.7, 0.052, 0.327, 0.63\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0195", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 1.2$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 8.60e-07$, temporary impact is $\\eta = 2.46e-05$, and trader risk aversion is $\\lambda = 5.37e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.37e-05 \\times 0.09}{2.46e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(1.2) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.37e-05 * 0.09 / 2.46e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 1.2, 2.46e-05, 5.37e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0196", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 96.73$, paying a known discrete dividend $D = 1.13$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 92.69$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 96.73$, $D e^{-r t_D} = 1.1021$, and $K e^{-r T} = 88.1695$.\nTheoretical difference $C_0 - P_0 = 96.73 - 1.1021 - 88.1695 = 7.4584$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 7.4584)$.", "ground_truth_answer": "C0 - P0 = 7.4584, Lower bound = 7.4584", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 96.73, 92.69, 1.13, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 7.4584, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0197", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.023$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.71$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.71) * q, dxi/dt = (xi^2 - 0.023*xi) / 1.71, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.71, 0.023, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0198", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 3.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.7750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0199", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.47$, $\\sigma_1 = 0.245$, and $\\sigma_2 = 0.221$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.06002 S_t^2 V_t + 0.0509 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.06002*S^2*V + 0.0509*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.06002 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 50.41, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.47 * dW1 + np.sqrt(1 - 0.47**2) * dZ\ndS = 0.0493 * S0 * dt + 0.245 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.221 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0493*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.06002*S0**2*V0 + 0.0509*S0**2*np.sqrt(V0))*dt + 2*0.245*S0**2*V0*dW1 + 0.221*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0200", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.076$ and volatility $\\sigma = 0.358$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 118.6$ at maturity $T = 0.69$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 118.6, 0)$.", "ground_truth_answer": "dV/dt + 0.076*S*dV/dS + 0.5*0.12816*S^2*d2V/dS2 - 0.076*V = 0, V(S, 0.69) = max(S - 118.6, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 118.6, 0.076, 0.358, 0.69\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0201", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 4.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.70e-06$, temporary impact is $\\eta = 9.90e-06$, and trader risk aversion is $\\lambda = 7.60e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.60e-06 \\times 0.09}{9.90e-06}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(4.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.6e-06 * 0.09 / 9.9e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 4.0, 9.9e-06, 7.6e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0202", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 101.49$, paying a known discrete dividend $D = 1.28$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 106.84$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 101.49$, $D e^{-r t_D} = 1.2484$, and $K e^{-r T} = 101.6294$.\nTheoretical difference $C_0 - P_0 = 101.49 - 1.2484 - 101.6294 = -1.3878$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -1.3878, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 101.49, 106.84, 1.28, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -1.3878, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0203", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.04$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.7$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.7) * q, dxi/dt = (xi^2 - 0.04*xi) / 1.7, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.7, 0.04, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0204", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 3.3$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.3}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.8250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.3\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0205", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.6$, $\\sigma_1 = 0.255$, and $\\sigma_2 = 0.172$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.06502 S_t^2 V_t + 0.05263 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.06502*S^2*V + 0.05263*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.06502 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 172.19, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.6 * dW1 + np.sqrt(1 - 0.6**2) * dZ\ndS = 0.0932 * S0 * dt + 0.255 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.172 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0932*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.06502*S0**2*V0 + 0.05263*S0**2*np.sqrt(V0))*dt + 2*0.255*S0**2*V0*dW1 + 0.172*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0206", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.061$ and volatility $\\sigma = 0.263$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 108.6$ at maturity $T = 1.85$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 108.6, 0)$.", "ground_truth_answer": "dV/dt + 0.061*S*dV/dS + 0.5*0.06917*S^2*d2V/dS2 - 0.061*V = 0, V(S, 1.85) = max(S - 108.6, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 108.6, 0.061, 0.263, 1.85\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0207", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 1.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.58e-06$, temporary impact is $\\eta = 3.76e-05$, and trader risk aversion is $\\lambda = 5.08e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.08e-05 \\times 0.09}{3.76e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(1.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.08e-05 * 0.09 / 3.76e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 1.9, 3.76e-05, 5.08e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0208", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 107.99$, paying a known discrete dividend $D = 2.09$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 97.68$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 107.99$, $D e^{-r t_D} = 2.0384$, and $K e^{-r T} = 92.9161$.\nTheoretical difference $C_0 - P_0 = 107.99 - 2.0384 - 92.9161 = 13.0355$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 13.0355)$.", "ground_truth_answer": "C0 - P0 = 13.0355, Lower bound = 13.0355", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 107.99, 97.68, 2.09, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 13.0355, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0209", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.032$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.15$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.15) * q, dxi/dt = (xi^2 - 0.032*xi) / 1.15, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.15, 0.032, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0210", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 7.0$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.0}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.7500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.0\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0211", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.05$, $\\sigma_1 = 0.309$, and $\\sigma_2 = 0.224$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09548 S_t^2 V_t + 0.00692 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.09548*S^2*V + 0.00692*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09548 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 100.24, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.05 * dW1 + np.sqrt(1 - 0.05**2) * dZ\ndS = 0.0511 * S0 * dt + 0.309 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.224 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0511*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.09548*S0**2*V0 + 0.00692*S0**2*np.sqrt(V0))*dt + 2*0.309*S0**2*V0*dW1 + 0.224*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0212", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.054$ and volatility $\\sigma = 0.399$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 110.1$ at maturity $T = 1.56$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 110.1, 0)$.", "ground_truth_answer": "dV/dt + 0.054*S*dV/dS + 0.5*0.15920*S^2*d2V/dS2 - 0.054*V = 0, V(S, 1.56) = max(S - 110.1, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 110.1, 0.054, 0.399, 1.56\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0213", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 4.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.75e-06$, temporary impact is $\\eta = 2.60e-06$, and trader risk aversion is $\\lambda = 5.74e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.74e-05 \\times 0.09}{2.60e-06}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(4.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.74e-05 * 0.09 / 2.6e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 4.0, 2.6e-06, 5.74e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0214", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 107.54$, paying a known discrete dividend $D = 2.64$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 96.84$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 107.54$, $D e^{-r t_D} = 2.5748$, and $K e^{-r T} = 92.1171$.\nTheoretical difference $C_0 - P_0 = 107.54 - 2.5748 - 92.1171 = 12.8481$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 12.8481)$.", "ground_truth_answer": "C0 - P0 = 12.8481, Lower bound = 12.8481", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 107.54, 96.84, 2.64, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 12.8481, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0215", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.025$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.19$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.19) * q, dxi/dt = (xi^2 - 0.025*xi) / 1.19, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.19, 0.025, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0216", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 8.4$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.4}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.1000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.4\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0217", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.23$, $\\sigma_1 = 0.294$, and $\\sigma_2 = 0.244$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.08644 S_t^2 V_t + 0.033 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.08644*S^2*V + 0.033*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.08644 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 72.49, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.23 * dW1 + np.sqrt(1 - 0.23**2) * dZ\ndS = 0.0583 * S0 * dt + 0.294 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.244 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0583*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.08644*S0**2*V0 + 0.033*S0**2*np.sqrt(V0))*dt + 2*0.294*S0**2*V0*dW1 + 0.244*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0218", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.054$ and volatility $\\sigma = 0.329$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 104.0$ at maturity $T = 1.74$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 104.0, 0)$.", "ground_truth_answer": "dV/dt + 0.054*S*dV/dS + 0.5*0.10824*S^2*d2V/dS2 - 0.054*V = 0, V(S, 1.74) = max(S - 104.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 104.0, 0.054, 0.329, 1.74\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0219", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 2.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.55e-06$, temporary impact is $\\eta = 2.96e-05$, and trader risk aversion is $\\lambda = 4.07e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{4.07e-05 \\times 0.09}{2.96e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(2.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(4.07e-05 * 0.09 / 2.96e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 2.8, 2.96e-05, 4.07e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0220", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 108.95$, paying a known discrete dividend $D = 2.17$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 93.07$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 108.95$, $D e^{-r t_D} = 2.1164$, and $K e^{-r T} = 88.5309$.\nTheoretical difference $C_0 - P_0 = 108.95 - 2.1164 - 88.5309 = 18.3027$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 18.3027)$.", "ground_truth_answer": "C0 - P0 = 18.3027, Lower bound = 18.3027", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 108.95, 93.07, 2.17, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 18.3027, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0221", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.014$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.88$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.88) * q, dxi/dt = (xi^2 - 0.014*xi) / 0.88, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.88, 0.014, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0222", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 9.5$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.5}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.3750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.5\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0223", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.56$, $\\sigma_1 = 0.334$, and $\\sigma_2 = 0.241$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.33467 S_t^3 V_t + -0.13523 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.33467*S^3*V + -0.13523*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.33467 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 134.77, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.56 * dW1 + np.sqrt(1 - -0.56**2) * dZ\ndS = 0.0957 * S0 * dt + 0.334 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.241 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0957*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.33467*S0**3*V0 + -0.13523*S0**3*np.sqrt(V0))*dt + 3*0.334*S0**3*V0*dW1 + 0.241*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0224", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.042$ and volatility $\\sigma = 0.167$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 83.1$ at maturity $T = 0.66$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 83.1, 0)$.", "ground_truth_answer": "dV/dt + 0.042*S*dV/dS + 0.5*0.02789*S^2*d2V/dS2 - 0.042*V = 0, V(S, 0.66) = max(S - 83.1, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 83.1, 0.042, 0.167, 0.66\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0225", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 4.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.64e-06$, temporary impact is $\\eta = 2.31e-05$, and trader risk aversion is $\\lambda = 1.22e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.22e-05 \\times 0.09}{2.31e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(4.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1.22e-05 * 0.09 / 2.31e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 4.9, 2.31e-05, 1.22e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0226", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 106.78$, paying a known discrete dividend $D = 2.84$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 92.49$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 106.78$, $D e^{-r t_D} = 2.7699$, and $K e^{-r T} = 87.9792$.\nTheoretical difference $C_0 - P_0 = 106.78 - 2.7699 - 87.9792 = 16.0309$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 16.0309)$.", "ground_truth_answer": "C0 - P0 = 16.0309, Lower bound = 16.0309", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 106.78, 92.49, 2.84, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 16.0309, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0227", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.022$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.84$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.84) * q, dxi/dt = (xi^2 - 0.022*xi) / 0.84, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.84, 0.022, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0228", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 5.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.3000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0229", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.27$, $\\sigma_1 = 0.311$, and $\\sigma_2 = 0.101$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09672 S_t^2 V_t + -0.01696 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.09672*S^2*V + -0.01696*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09672 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 58.21, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.27 * dW1 + np.sqrt(1 - -0.27**2) * dZ\ndS = 0.0668 * S0 * dt + 0.311 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.101 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0668*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.09672*S0**2*V0 + -0.01696*S0**2*np.sqrt(V0))*dt + 2*0.311*S0**2*V0*dW1 + 0.101*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0230", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.045$ and volatility $\\sigma = 0.366$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 116.9$ at maturity $T = 1.2$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 116.9, 0)$.", "ground_truth_answer": "dV/dt + 0.045*S*dV/dS + 0.5*0.13396*S^2*d2V/dS2 - 0.045*V = 0, V(S, 1.2) = max(S - 116.9, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 116.9, 0.045, 0.366, 1.2\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0231", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 2.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.71e-06$, temporary impact is $\\eta = 2.32e-05$, and trader risk aversion is $\\lambda = 2.32e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{2.32e-05 \\times 0.09}{2.32e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(2.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(2.32e-05 * 0.09 / 2.32e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 2.8, 2.32e-05, 2.32e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0232", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 92.82$, paying a known discrete dividend $D = 2.00$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 93.53$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 92.82$, $D e^{-r t_D} = 1.9506$, and $K e^{-r T} = 88.9685$.\nTheoretical difference $C_0 - P_0 = 92.82 - 1.9506 - 88.9685 = 1.9009$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 1.9009)$.", "ground_truth_answer": "C0 - P0 = 1.9009, Lower bound = 1.9009", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 92.82, 93.53, 2.0, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 1.9009, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0233", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.011$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.97$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.97) * q, dxi/dt = (xi^2 - 0.011*xi) / 0.97, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.97, 0.011, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0234", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 6.6$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.6}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.6500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.6\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0235", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.74$, $\\sigma_1 = 0.283$, and $\\sigma_2 = 0.136$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.08009 S_t^2 V_t + 0.05696 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.08009*S^2*V + 0.05696*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.08009 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 144.84, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.74 * dW1 + np.sqrt(1 - 0.74**2) * dZ\ndS = 0.041 * S0 * dt + 0.283 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.136 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.041*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.08009*S0**2*V0 + 0.05696*S0**2*np.sqrt(V0))*dt + 2*0.283*S0**2*V0*dW1 + 0.136*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0236", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.053$ and volatility $\\sigma = 0.365$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 101.4$ at maturity $T = 0.78$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 101.4, 0)$.", "ground_truth_answer": "dV/dt + 0.053*S*dV/dS + 0.5*0.13322*S^2*d2V/dS2 - 0.053*V = 0, V(S, 0.78) = max(S - 101.4, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 101.4, 0.053, 0.365, 0.78\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0237", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 1.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.02e-06$, temporary impact is $\\eta = 4.30e-06$, and trader risk aversion is $\\lambda = 7.52e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.52e-05 \\times 0.09}{4.30e-06}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(1.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.52e-05 * 0.09 / 4.3e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 1.8, 4.3e-06, 7.52e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0238", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 107.96$, paying a known discrete dividend $D = 1.38$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 94.10$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 107.96$, $D e^{-r t_D} = 1.3459$, and $K e^{-r T} = 89.5107$.\nTheoretical difference $C_0 - P_0 = 107.96 - 1.3459 - 89.5107 = 17.1034$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 17.1034)$.", "ground_truth_answer": "C0 - P0 = 17.1034, Lower bound = 17.1034", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 107.96, 94.1, 1.38, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 17.1034, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0239", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.025$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.75$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.75) * q, dxi/dt = (xi^2 - 0.025*xi) / 1.75, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.75, 0.025, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0240", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 2.5$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{2.5}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.6250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 2.5\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0241", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.16$, $\\sigma_1 = 0.255$, and $\\sigma_2 = 0.188$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.19508 S_t^3 V_t + -0.02301 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.19508*S^3*V + -0.02301*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.19508 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 166.33, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.16 * dW1 + np.sqrt(1 - -0.16**2) * dZ\ndS = 0.0763 * S0 * dt + 0.255 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.188 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0763*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.19508*S0**3*V0 + -0.02301*S0**3*np.sqrt(V0))*dt + 3*0.255*S0**3*V0*dW1 + 0.188*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0242", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.066$ and volatility $\\sigma = 0.176$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 93.4$ at maturity $T = 0.61$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 93.4, 0)$.", "ground_truth_answer": "dV/dt + 0.066*S*dV/dS + 0.5*0.03098*S^2*d2V/dS2 - 0.066*V = 0, V(S, 0.61) = max(S - 93.4, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 93.4, 0.066, 0.176, 0.61\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0243", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 2.6$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.93e-06$, temporary impact is $\\eta = 1.43e-05$, and trader risk aversion is $\\lambda = 6.48e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.48e-05 \\times 0.09}{1.43e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(2.6) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.48e-05 * 0.09 / 1.43e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 2.6, 1.43e-05, 6.48e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0244", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 90.51$, paying a known discrete dividend $D = 2.43$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 93.12$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 90.51$, $D e^{-r t_D} = 2.37$, and $K e^{-r T} = 88.5785$.\nTheoretical difference $C_0 - P_0 = 90.51 - 2.37 - 88.5785 = -0.4385$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -0.4385, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 90.51, 93.12, 2.43, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -0.4385, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0245", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.026$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.33$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.33) * q, dxi/dt = (xi^2 - 0.026*xi) / 1.33, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.33, 0.026, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0246", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 3.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.9500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0247", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.51$, $\\sigma_1 = 0.171$, and $\\sigma_2 = 0.26$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.02924 S_t^2 V_t + -0.04535 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.02924*S^2*V + -0.04535*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.02924 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 150.78, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.51 * dW1 + np.sqrt(1 - -0.51**2) * dZ\ndS = 0.0416 * S0 * dt + 0.171 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.26 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0416*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.02924*S0**2*V0 + -0.04535*S0**2*np.sqrt(V0))*dt + 2*0.171*S0**2*V0*dW1 + 0.26*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0248", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.053$ and volatility $\\sigma = 0.33$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 112.2$ at maturity $T = 1.98$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 112.2, 0)$.", "ground_truth_answer": "dV/dt + 0.053*S*dV/dS + 0.5*0.10890*S^2*d2V/dS2 - 0.053*V = 0, V(S, 1.98) = max(S - 112.2, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 112.2, 0.053, 0.33, 1.98\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0249", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 1.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.17e-06$, temporary impact is $\\eta = 2.05e-05$, and trader risk aversion is $\\lambda = 6.71e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.71e-05 \\times 0.09}{2.05e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(1.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.71e-05 * 0.09 / 2.05e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 1.8, 2.05e-05, 6.71e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0250", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 95.86$, paying a known discrete dividend $D = 1.03$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 107.93$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 95.86$, $D e^{-r t_D} = 1.0046$, and $K e^{-r T} = 102.6662$.\nTheoretical difference $C_0 - P_0 = 95.86 - 1.0046 - 102.6662 = -7.8108$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -7.8108, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 95.86, 107.93, 1.03, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -7.8108, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0251", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.039$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.77$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.77) * q, dxi/dt = (xi^2 - 0.039*xi) / 1.77, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.77, 0.039, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0252", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 9.0$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.0}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.2500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.0\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0253", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.26$, $\\sigma_1 = 0.332$, and $\\sigma_2 = 0.225$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.11022 S_t^2 V_t + -0.03884 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.11022*S^2*V + -0.03884*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.11022 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 146.44, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.26 * dW1 + np.sqrt(1 - -0.26**2) * dZ\ndS = 0.0963 * S0 * dt + 0.332 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.225 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0963*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.11022*S0**2*V0 + -0.03884*S0**2*np.sqrt(V0))*dt + 2*0.332*S0**2*V0*dW1 + 0.225*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0254", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.043$ and volatility $\\sigma = 0.298$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 90.7$ at maturity $T = 1.44$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 90.7, 0)$.", "ground_truth_answer": "dV/dt + 0.043*S*dV/dS + 0.5*0.08880*S^2*d2V/dS2 - 0.043*V = 0, V(S, 1.44) = max(S - 90.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 90.7, 0.043, 0.298, 1.44\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0255", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 1.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.89e-06$, temporary impact is $\\eta = 1.88e-05$, and trader risk aversion is $\\lambda = 8.62e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{8.62e-05 \\times 0.09}{1.88e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(1.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(8.62e-05 * 0.09 / 1.88e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 1.9, 1.88e-05, 8.62e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0256", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 109.49$, paying a known discrete dividend $D = 1.23$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 105.60$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 109.49$, $D e^{-r t_D} = 1.1996$, and $K e^{-r T} = 100.4498$.\nTheoretical difference $C_0 - P_0 = 109.49 - 1.1996 - 100.4498 = 7.8406$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 7.8406)$.", "ground_truth_answer": "C0 - P0 = 7.8406, Lower bound = 7.8406", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 109.49, 105.6, 1.23, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 7.8406, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0257", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.029$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.84$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.84) * q, dxi/dt = (xi^2 - 0.029*xi) / 1.84, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.84, 0.029, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0258", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 5.9$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.9}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.4750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.9\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0259", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.45$, $\\sigma_1 = 0.29$, and $\\sigma_2 = 0.181$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.2523 S_t^3 V_t + -0.07086 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.2523*S^3*V + -0.07086*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.2523 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 126.87, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.45 * dW1 + np.sqrt(1 - -0.45**2) * dZ\ndS = 0.0993 * S0 * dt + 0.29 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.181 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0993*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.2523*S0**3*V0 + -0.07086*S0**3*np.sqrt(V0))*dt + 3*0.29*S0**3*V0*dW1 + 0.181*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0260", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.07$ and volatility $\\sigma = 0.396$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 101.0$ at maturity $T = 0.76$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 101.0, 0)$.", "ground_truth_answer": "dV/dt + 0.07*S*dV/dS + 0.5*0.15682*S^2*d2V/dS2 - 0.07*V = 0, V(S, 0.76) = max(S - 101.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 101.0, 0.07, 0.396, 0.76\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0261", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 4.3$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.45e-06$, temporary impact is $\\eta = 4.13e-05$, and trader risk aversion is $\\lambda = 5.34e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.34e-05 \\times 0.09}{4.13e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(4.3) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.34e-05 * 0.09 / 4.13e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 4.3, 4.13e-05, 5.34e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0262", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 99.96$, paying a known discrete dividend $D = 1.81$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 91.34$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 99.96$, $D e^{-r t_D} = 1.7653$, and $K e^{-r T} = 86.8853$.\nTheoretical difference $C_0 - P_0 = 99.96 - 1.7653 - 86.8853 = 11.3094$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 11.3094)$.", "ground_truth_answer": "C0 - P0 = 11.3094, Lower bound = 11.3094", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 99.96, 91.34, 1.81, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 11.3094, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0263", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.043$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.81$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.81) * q, dxi/dt = (xi^2 - 0.043*xi) / 0.81, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.81, 0.043, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0264", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 3.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.7750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0265", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.21$, $\\sigma_1 = 0.296$, and $\\sigma_2 = 0.15$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.08762 S_t^2 V_t + 0.01865 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.08762*S^2*V + 0.01865*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.08762 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 89.55, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.21 * dW1 + np.sqrt(1 - 0.21**2) * dZ\ndS = 0.0613 * S0 * dt + 0.296 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.15 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0613*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.08762*S0**2*V0 + 0.01865*S0**2*np.sqrt(V0))*dt + 2*0.296*S0**2*V0*dW1 + 0.15*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0266", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.031$ and volatility $\\sigma = 0.379$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 96.8$ at maturity $T = 1.07$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 96.8, 0)$.", "ground_truth_answer": "dV/dt + 0.031*S*dV/dS + 0.5*0.14364*S^2*d2V/dS2 - 0.031*V = 0, V(S, 1.07) = max(S - 96.8, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 96.8, 0.031, 0.379, 1.07\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0267", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 1.7$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.17e-06$, temporary impact is $\\eta = 1.83e-05$, and trader risk aversion is $\\lambda = 9.59e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.59e-05 \\times 0.09}{1.83e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(1.7) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.59e-05 * 0.09 / 1.83e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 1.7, 1.83e-05, 9.59e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0268", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 91.81$, paying a known discrete dividend $D = 1.14$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 105.42$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 91.81$, $D e^{-r t_D} = 1.1119$, and $K e^{-r T} = 100.2786$.\nTheoretical difference $C_0 - P_0 = 91.81 - 1.1119 - 100.2786 = -9.5805$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -9.5805, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 91.81, 105.42, 1.14, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -9.5805, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0269", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.022$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.03$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.03) * q, dxi/dt = (xi^2 - 0.022*xi) / 1.03, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.03, 0.022, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0270", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 7.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.9500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0271", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.58$, $\\sigma_1 = 0.229$, and $\\sigma_2 = 0.291$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.15732 S_t^3 V_t + -0.11595 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.15732*S^3*V + -0.11595*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.15732 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 141.56, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.58 * dW1 + np.sqrt(1 - -0.58**2) * dZ\ndS = 0.1159 * S0 * dt + 0.229 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.291 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.1159*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.15732*S0**3*V0 + -0.11595*S0**3*np.sqrt(V0))*dt + 3*0.229*S0**3*V0*dW1 + 0.291*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0272", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.033$ and volatility $\\sigma = 0.158$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 90.5$ at maturity $T = 1.39$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 90.5, 0)$.", "ground_truth_answer": "dV/dt + 0.033*S*dV/dS + 0.5*0.02496*S^2*d2V/dS2 - 0.033*V = 0, V(S, 1.39) = max(S - 90.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 90.5, 0.033, 0.158, 1.39\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0273", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 3.5$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.25e-06$, temporary impact is $\\eta = 4.78e-05$, and trader risk aversion is $\\lambda = 1.63e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.63e-05 \\times 0.09}{4.78e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(3.5) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1.63e-05 * 0.09 / 4.78e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 3.5, 4.78e-05, 1.63e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0274", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 99.48$, paying a known discrete dividend $D = 1.70$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 96.89$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 99.48$, $D e^{-r t_D} = 1.658$, and $K e^{-r T} = 92.1646$.\nTheoretical difference $C_0 - P_0 = 99.48 - 1.658 - 92.1646 = 5.6574$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 5.6574)$.", "ground_truth_answer": "C0 - P0 = 5.6574, Lower bound = 5.6574", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 99.48, 96.89, 1.7, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 5.6574, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0275", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.03$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.53$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.53) * q, dxi/dt = (xi^2 - 0.03*xi) / 1.53, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.53, 0.03, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0276", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 5.7$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.7}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.4250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.7\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0277", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.79$, $\\sigma_1 = 0.15$, and $\\sigma_2 = 0.294$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.0675 S_t^3 V_t + -0.10452 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.0675*S^3*V + -0.10452*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.0675 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 61.39, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.79 * dW1 + np.sqrt(1 - -0.79**2) * dZ\ndS = 0.0462 * S0 * dt + 0.15 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.294 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0462*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.0675*S0**3*V0 + -0.10452*S0**3*np.sqrt(V0))*dt + 3*0.15*S0**3*V0*dW1 + 0.294*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0278", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.042$ and volatility $\\sigma = 0.173$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 116.7$ at maturity $T = 0.71$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 116.7, 0)$.", "ground_truth_answer": "dV/dt + 0.042*S*dV/dS + 0.5*0.02993*S^2*d2V/dS2 - 0.042*V = 0, V(S, 0.71) = max(S - 116.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 116.7, 0.042, 0.173, 0.71\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0279", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 4.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.48e-06$, temporary impact is $\\eta = 2.65e-05$, and trader risk aversion is $\\lambda = 9.60e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.60e-06 \\times 0.09}{2.65e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(4.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.6e-06 * 0.09 / 2.65e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 4.8, 2.65e-05, 9.6e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0280", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 105.17$, paying a known discrete dividend $D = 2.52$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 102.78$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 105.17$, $D e^{-r t_D} = 2.4578$, and $K e^{-r T} = 97.7674$.\nTheoretical difference $C_0 - P_0 = 105.17 - 2.4578 - 97.7674 = 4.9448$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 4.9448)$.", "ground_truth_answer": "C0 - P0 = 4.9448, Lower bound = 4.9448", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 105.17, 102.78, 2.52, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 4.9448, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0281", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.038$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.77$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.77) * q, dxi/dt = (xi^2 - 0.038*xi) / 1.77, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.77, 0.038, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0282", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 9.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.3000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0283", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.73$, $\\sigma_1 = 0.16$, and $\\sigma_2 = 0.234$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.0768 S_t^3 V_t + -0.08199 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.0768*S^3*V + -0.08199*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.0768 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 147.0, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.73 * dW1 + np.sqrt(1 - -0.73**2) * dZ\ndS = 0.0955 * S0 * dt + 0.16 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.234 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0955*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.0768*S0**3*V0 + -0.08199*S0**3*np.sqrt(V0))*dt + 3*0.16*S0**3*V0*dW1 + 0.234*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0284", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.076$ and volatility $\\sigma = 0.195$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 102.7$ at maturity $T = 1.87$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 102.7, 0)$.", "ground_truth_answer": "dV/dt + 0.076*S*dV/dS + 0.5*0.03803*S^2*d2V/dS2 - 0.076*V = 0, V(S, 1.87) = max(S - 102.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 102.7, 0.076, 0.195, 1.87\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0285", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 1.5$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 6.90e-07$, temporary impact is $\\eta = 3.68e-05$, and trader risk aversion is $\\lambda = 2.01e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{2.01e-05 \\times 0.09}{3.68e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(1.5) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(2.01e-05 * 0.09 / 3.68e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 1.5, 3.68e-05, 2.01e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0286", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 98.44$, paying a known discrete dividend $D = 2.49$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 105.91$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 98.44$, $D e^{-r t_D} = 2.4285$, and $K e^{-r T} = 100.7447$.\nTheoretical difference $C_0 - P_0 = 98.44 - 2.4285 - 100.7447 = -4.7332$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -4.7332, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 98.44, 105.91, 2.49, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -4.7332, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0287", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.028$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.28$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.28) * q, dxi/dt = (xi^2 - 0.028*xi) / 1.28, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.28, 0.028, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0288", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 2.3$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{2.3}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.5750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 2.3\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0289", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.31$, $\\sigma_1 = 0.174$, and $\\sigma_2 = 0.115$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.09083 S_t^3 V_t + 0.01861 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.09083*S^3*V + 0.01861*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.09083 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 139.44, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.31 * dW1 + np.sqrt(1 - 0.31**2) * dZ\ndS = 0.0584 * S0 * dt + 0.174 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.115 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0584*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.09083*S0**3*V0 + 0.01861*S0**3*np.sqrt(V0))*dt + 3*0.174*S0**3*V0*dW1 + 0.115*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0290", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.046$ and volatility $\\sigma = 0.251$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 102.9$ at maturity $T = 1.71$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 102.9, 0)$.", "ground_truth_answer": "dV/dt + 0.046*S*dV/dS + 0.5*0.06300*S^2*d2V/dS2 - 0.046*V = 0, V(S, 1.71) = max(S - 102.9, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 102.9, 0.046, 0.251, 1.71\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0291", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 2.7$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.34e-06$, temporary impact is $\\eta = 3.72e-05$, and trader risk aversion is $\\lambda = 5.25e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.25e-05 \\times 0.09}{3.72e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(2.7) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.25e-05 * 0.09 / 3.72e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 2.7, 3.72e-05, 5.25e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0292", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 107.53$, paying a known discrete dividend $D = 1.92$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 98.35$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 107.53$, $D e^{-r t_D} = 1.8726$, and $K e^{-r T} = 93.5534$.\nTheoretical difference $C_0 - P_0 = 107.53 - 1.8726 - 93.5534 = 12.1040$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 12.1040)$.", "ground_truth_answer": "C0 - P0 = 12.1040, Lower bound = 12.1040", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 107.53, 98.35, 1.92, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 12.104, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0293", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.011$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.81$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.81) * q, dxi/dt = (xi^2 - 0.011*xi) / 1.81, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.81, 0.011, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0294", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 5.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.2750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0295", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.66$, $\\sigma_1 = 0.152$, and $\\sigma_2 = 0.111$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.06931 S_t^3 V_t + -0.03341 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.06931*S^3*V + -0.03341*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.06931 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 189.89, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.66 * dW1 + np.sqrt(1 - -0.66**2) * dZ\ndS = 0.0456 * S0 * dt + 0.152 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.111 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0456*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.06931*S0**3*V0 + -0.03341*S0**3*np.sqrt(V0))*dt + 3*0.152*S0**3*V0*dW1 + 0.111*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0296", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.049$ and volatility $\\sigma = 0.307$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 114.9$ at maturity $T = 1.98$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 114.9, 0)$.", "ground_truth_answer": "dV/dt + 0.049*S*dV/dS + 0.5*0.09425*S^2*d2V/dS2 - 0.049*V = 0, V(S, 1.98) = max(S - 114.9, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 114.9, 0.049, 0.307, 1.98\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0297", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 3.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 5.50e-07$, temporary impact is $\\eta = 1.75e-05$, and trader risk aversion is $\\lambda = 5.27e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.27e-05 \\times 0.09}{1.75e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(3.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.27e-05 * 0.09 / 1.75e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 3.9, 1.75e-05, 5.27e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0298", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 90.07$, paying a known discrete dividend $D = 1.59$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 99.35$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 90.07$, $D e^{-r t_D} = 1.5507$, and $K e^{-r T} = 94.5046$.\nTheoretical difference $C_0 - P_0 = 90.07 - 1.5507 - 94.5046 = -5.9853$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -5.9853, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 90.07, 99.35, 1.59, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -5.9853, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0299", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.022$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.85$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.85) * q, dxi/dt = (xi^2 - 0.022*xi) / 0.85, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.85, 0.022, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0300", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 4.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.0500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0301", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.6$, $\\sigma_1 = 0.172$, and $\\sigma_2 = 0.178$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.02958 S_t^2 V_t + -0.03674 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.02958*S^2*V + -0.03674*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.02958 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 186.55, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.6 * dW1 + np.sqrt(1 - -0.6**2) * dZ\ndS = 0.0436 * S0 * dt + 0.172 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.178 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0436*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.02958*S0**2*V0 + -0.03674*S0**2*np.sqrt(V0))*dt + 2*0.172*S0**2*V0*dW1 + 0.178*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0302", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.077$ and volatility $\\sigma = 0.347$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 83.6$ at maturity $T = 1.13$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 83.6, 0)$.", "ground_truth_answer": "dV/dt + 0.077*S*dV/dS + 0.5*0.12041*S^2*d2V/dS2 - 0.077*V = 0, V(S, 1.13) = max(S - 83.6, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 83.6, 0.077, 0.347, 1.13\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0303", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 1.7$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.73e-06$, temporary impact is $\\eta = 2.39e-05$, and trader risk aversion is $\\lambda = 6.17e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.17e-05 \\times 0.09}{2.39e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(1.7) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.17e-05 * 0.09 / 2.39e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 1.7, 2.39e-05, 6.17e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0304", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 109.82$, paying a known discrete dividend $D = 2.89$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 94.63$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 109.82$, $D e^{-r t_D} = 2.8186$, and $K e^{-r T} = 90.0148$.\nTheoretical difference $C_0 - P_0 = 109.82 - 2.8186 - 90.0148 = 16.9866$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 16.9866)$.", "ground_truth_answer": "C0 - P0 = 16.9866, Lower bound = 16.9866", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 109.82, 94.63, 2.89, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 16.9866, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0305", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.019$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.75$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.75) * q, dxi/dt = (xi^2 - 0.019*xi) / 1.75, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.75, 0.019, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0306", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 3.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.9500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0307", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.24$, $\\sigma_1 = 0.187$, and $\\sigma_2 = 0.256$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.03497 S_t^2 V_t + -0.02298 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.03497*S^2*V + -0.02298*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.03497 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 76.48, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.24 * dW1 + np.sqrt(1 - -0.24**2) * dZ\ndS = 0.0576 * S0 * dt + 0.187 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.256 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0576*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.03497*S0**2*V0 + -0.02298*S0**2*np.sqrt(V0))*dt + 2*0.187*S0**2*V0*dW1 + 0.256*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0308", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.058$ and volatility $\\sigma = 0.204$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 100.7$ at maturity $T = 1.4$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 100.7, 0)$.", "ground_truth_answer": "dV/dt + 0.058*S*dV/dS + 0.5*0.04162*S^2*d2V/dS2 - 0.058*V = 0, V(S, 1.4) = max(S - 100.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 100.7, 0.058, 0.204, 1.4\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0309", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 9.50e-07$, temporary impact is $\\eta = 2.04e-05$, and trader risk aversion is $\\lambda = 7.61e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.61e-05 \\times 0.09}{2.04e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.61e-05 * 0.09 / 2.04e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.8, 2.04e-05, 7.61e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0310", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 93.08$, paying a known discrete dividend $D = 1.45$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 106.32$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 93.08$, $D e^{-r t_D} = 1.4142$, and $K e^{-r T} = 101.1347$.\nTheoretical difference $C_0 - P_0 = 93.08 - 1.4142 - 101.1347 = -9.4689$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -9.4689, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 93.08, 106.32, 1.45, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -9.4689, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0311", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.031$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.39$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.39) * q, dxi/dt = (xi^2 - 0.031*xi) / 1.39, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.39, 0.031, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0312", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 8.9$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.9}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.2250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.9\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0313", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.73$, $\\sigma_1 = 0.205$, and $\\sigma_2 = 0.195$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.12608 S_t^3 V_t + -0.08755 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.12608*S^3*V + -0.08755*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.12608 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 118.61, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.73 * dW1 + np.sqrt(1 - -0.73**2) * dZ\ndS = 0.0713 * S0 * dt + 0.205 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.195 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0713*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.12608*S0**3*V0 + -0.08755*S0**3*np.sqrt(V0))*dt + 3*0.205*S0**3*V0*dW1 + 0.195*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0314", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.072$ and volatility $\\sigma = 0.352$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 106.2$ at maturity $T = 1.33$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 106.2, 0)$.", "ground_truth_answer": "dV/dt + 0.072*S*dV/dS + 0.5*0.12390*S^2*d2V/dS2 - 0.072*V = 0, V(S, 1.33) = max(S - 106.2, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 106.2, 0.072, 0.352, 1.33\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0315", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 3.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.48e-06$, temporary impact is $\\eta = 1.34e-05$, and trader risk aversion is $\\lambda = 1.50e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.50e-06 \\times 0.09}{1.34e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(3.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1.5e-06 * 0.09 / 1.34e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 3.8, 1.34e-05, 1.5e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0316", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 90.98$, paying a known discrete dividend $D = 2.92$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 100.65$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 90.98$, $D e^{-r t_D} = 2.8479$, and $K e^{-r T} = 95.7412$.\nTheoretical difference $C_0 - P_0 = 90.98 - 2.8479 - 95.7412 = -7.6091$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -7.6091, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 90.98, 100.65, 2.92, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -7.6091, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0317", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.046$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.99$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.99) * q, dxi/dt = (xi^2 - 0.046*xi) / 1.99, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.99, 0.046, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0318", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 6.0$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.0}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.5000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.0\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0319", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.28$, $\\sigma_1 = 0.315$, and $\\sigma_2 = 0.17$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09922 S_t^2 V_t + 0.02999 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.09922*S^2*V + 0.02999*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09922 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 122.09, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.28 * dW1 + np.sqrt(1 - 0.28**2) * dZ\ndS = 0.0874 * S0 * dt + 0.315 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.17 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0874*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.09922*S0**2*V0 + 0.02999*S0**2*np.sqrt(V0))*dt + 2*0.315*S0**2*V0*dW1 + 0.17*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0320", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.072$ and volatility $\\sigma = 0.333$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 100.9$ at maturity $T = 1.8$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 100.9, 0)$.", "ground_truth_answer": "dV/dt + 0.072*S*dV/dS + 0.5*0.11089*S^2*d2V/dS2 - 0.072*V = 0, V(S, 1.8) = max(S - 100.9, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 100.9, 0.072, 0.333, 1.8\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0321", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 2.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 8.70e-07$, temporary impact is $\\eta = 8.90e-06$, and trader risk aversion is $\\lambda = 3.41e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.41e-05 \\times 0.09}{8.90e-06}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(2.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.41e-05 * 0.09 / 8.9e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 2.0, 8.9e-06, 3.41e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0322", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 108.60$, paying a known discrete dividend $D = 2.40$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 92.12$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 108.6$, $D e^{-r t_D} = 2.3407$, and $K e^{-r T} = 87.6273$.\nTheoretical difference $C_0 - P_0 = 108.6 - 2.3407 - 87.6273 = 18.6320$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 18.6320)$.", "ground_truth_answer": "C0 - P0 = 18.6320, Lower bound = 18.6320", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 108.6, 92.12, 2.4, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 18.632, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0323", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.045$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.94$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.94) * q, dxi/dt = (xi^2 - 0.045*xi) / 1.94, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.94, 0.045, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0324", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 2.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{2.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.5500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 2.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0325", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.54$, $\\sigma_1 = 0.217$, and $\\sigma_2 = 0.249$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.14127 S_t^3 V_t + -0.08753 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.14127*S^3*V + -0.08753*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.14127 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 173.87, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.54 * dW1 + np.sqrt(1 - -0.54**2) * dZ\ndS = 0.0503 * S0 * dt + 0.217 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.249 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0503*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.14127*S0**3*V0 + -0.08753*S0**3*np.sqrt(V0))*dt + 3*0.217*S0**3*V0*dW1 + 0.249*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0326", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.053$ and volatility $\\sigma = 0.339$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 90.3$ at maturity $T = 0.79$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 90.3, 0)$.", "ground_truth_answer": "dV/dt + 0.053*S*dV/dS + 0.5*0.11492*S^2*d2V/dS2 - 0.053*V = 0, V(S, 0.79) = max(S - 90.3, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 90.3, 0.053, 0.339, 0.79\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0327", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 2.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.12e-06$, temporary impact is $\\eta = 4.91e-05$, and trader risk aversion is $\\lambda = 6.35e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.35e-05 \\times 0.09}{4.91e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(2.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.35e-05 * 0.09 / 4.91e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 2.0, 4.91e-05, 6.35e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0328", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 102.68$, paying a known discrete dividend $D = 2.56$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 100.80$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 102.68$, $D e^{-r t_D} = 2.4968$, and $K e^{-r T} = 95.8839$.\nTheoretical difference $C_0 - P_0 = 102.68 - 2.4968 - 95.8839 = 4.2993$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 4.2993)$.", "ground_truth_answer": "C0 - P0 = 4.2993, Lower bound = 4.2993", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 102.68, 100.8, 2.56, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 4.2993, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0329", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.021$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.53$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.53) * q, dxi/dt = (xi^2 - 0.021*xi) / 0.53, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.53, 0.021, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0330", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 9.7$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.7}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.4250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.7\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0331", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.7$, $\\sigma_1 = 0.336$, and $\\sigma_2 = 0.121$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.33869 S_t^3 V_t + 0.08538 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.33869*S^3*V + 0.08538*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.33869 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 101.28, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.7 * dW1 + np.sqrt(1 - 0.7**2) * dZ\ndS = 0.0906 * S0 * dt + 0.336 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.121 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0906*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.33869*S0**3*V0 + 0.08538*S0**3*np.sqrt(V0))*dt + 3*0.336*S0**3*V0*dW1 + 0.121*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0332", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.066$ and volatility $\\sigma = 0.387$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 86.7$ at maturity $T = 1.66$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 86.7, 0)$.", "ground_truth_answer": "dV/dt + 0.066*S*dV/dS + 0.5*0.14977*S^2*d2V/dS2 - 0.066*V = 0, V(S, 1.66) = max(S - 86.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 86.7, 0.066, 0.387, 1.66\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0333", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 1.2$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.95e-06$, temporary impact is $\\eta = 1.79e-05$, and trader risk aversion is $\\lambda = 6.25e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.25e-05 \\times 0.09}{1.79e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(1.2) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.25e-05 * 0.09 / 1.79e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 1.2, 1.79e-05, 6.25e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0334", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 107.43$, paying a known discrete dividend $D = 2.94$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 109.47$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 107.43$, $D e^{-r t_D} = 2.8674$, and $K e^{-r T} = 104.1311$.\nTheoretical difference $C_0 - P_0 = 107.43 - 2.8674 - 104.1311 = 0.4315$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.4315)$.", "ground_truth_answer": "C0 - P0 = 0.4315, Lower bound = 0.4315", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 107.43, 109.47, 2.94, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 0.4315, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0335", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.015$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.64$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.64) * q, dxi/dt = (xi^2 - 0.015*xi) / 1.64, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.64, 0.015, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0336", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 2.5$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{2.5}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.6250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 2.5\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0337", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.8$, $\\sigma_1 = 0.314$, and $\\sigma_2 = 0.151$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.29579 S_t^3 V_t + -0.11379 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.29579*S^3*V + -0.11379*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.29579 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 173.23, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.8 * dW1 + np.sqrt(1 - -0.8**2) * dZ\ndS = 0.0697 * S0 * dt + 0.314 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.151 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0697*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.29579*S0**3*V0 + -0.11379*S0**3*np.sqrt(V0))*dt + 3*0.314*S0**3*V0*dW1 + 0.151*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0338", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.036$ and volatility $\\sigma = 0.399$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 97.0$ at maturity $T = 1.18$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 97.0, 0)$.", "ground_truth_answer": "dV/dt + 0.036*S*dV/dS + 0.5*0.15920*S^2*d2V/dS2 - 0.036*V = 0, V(S, 1.18) = max(S - 97.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 97.0, 0.036, 0.399, 1.18\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0339", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 4.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.68e-06$, temporary impact is $\\eta = 4.15e-05$, and trader risk aversion is $\\lambda = 3.05e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.05e-05 \\times 0.09}{4.15e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(4.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.05e-05 * 0.09 / 4.15e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 4.4, 4.15e-05, 3.05e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0340", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 105.46$, paying a known discrete dividend $D = 1.26$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 94.60$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 105.46$, $D e^{-r t_D} = 1.2289$, and $K e^{-r T} = 89.9863$.\nTheoretical difference $C_0 - P_0 = 105.46 - 1.2289 - 89.9863 = 14.2448$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 14.2448)$.", "ground_truth_answer": "C0 - P0 = 14.2448, Lower bound = 14.2448", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 105.46, 94.6, 1.26, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 14.2448, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0341", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.048$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.73$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.73) * q, dxi/dt = (xi^2 - 0.048*xi) / 0.73, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.73, 0.048, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0342", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 9.5$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.5}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.3750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.5\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0343", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.77$, $\\sigma_1 = 0.23$, and $\\sigma_2 = 0.155$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0529 S_t^2 V_t + 0.0549 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0529*S^2*V + 0.0549*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0529 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 112.96, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.77 * dW1 + np.sqrt(1 - 0.77**2) * dZ\ndS = 0.0911 * S0 * dt + 0.23 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.155 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0911*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0529*S0**2*V0 + 0.0549*S0**2*np.sqrt(V0))*dt + 2*0.23*S0**2*V0*dW1 + 0.155*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0344", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.039$ and volatility $\\sigma = 0.331$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 109.8$ at maturity $T = 0.8$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 109.8, 0)$.", "ground_truth_answer": "dV/dt + 0.039*S*dV/dS + 0.5*0.10956*S^2*d2V/dS2 - 0.039*V = 0, V(S, 0.8) = max(S - 109.8, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 109.8, 0.039, 0.331, 0.8\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0345", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 2.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.29e-06$, temporary impact is $\\eta = 1.91e-05$, and trader risk aversion is $\\lambda = 8.66e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{8.66e-05 \\times 0.09}{1.91e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(2.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(8.66e-05 * 0.09 / 1.91e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 2.9, 1.91e-05, 8.66e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0346", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 109.36$, paying a known discrete dividend $D = 2.74$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 93.71$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 109.36$, $D e^{-r t_D} = 2.6723$, and $K e^{-r T} = 89.1397$.\nTheoretical difference $C_0 - P_0 = 109.36 - 2.6723 - 89.1397 = 17.5480$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 17.5480)$.", "ground_truth_answer": "C0 - P0 = 17.5480, Lower bound = 17.5480", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 109.36, 93.71, 2.74, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 17.548, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0347", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.016$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.18$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.18) * q, dxi/dt = (xi^2 - 0.016*xi) / 1.18, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.18, 0.016, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0348", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 8.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.0250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0349", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.19$, $\\sigma_1 = 0.157$, and $\\sigma_2 = 0.284$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.07395 S_t^3 V_t + 0.02542 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.07395*S^3*V + 0.02542*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.07395 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 143.93, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.19 * dW1 + np.sqrt(1 - 0.19**2) * dZ\ndS = 0.0505 * S0 * dt + 0.157 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.284 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0505*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.07395*S0**3*V0 + 0.02542*S0**3*np.sqrt(V0))*dt + 3*0.157*S0**3*V0*dW1 + 0.284*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0350", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.048$ and volatility $\\sigma = 0.15$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 103.9$ at maturity $T = 1.41$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 103.9, 0)$.", "ground_truth_answer": "dV/dt + 0.048*S*dV/dS + 0.5*0.02250*S^2*d2V/dS2 - 0.048*V = 0, V(S, 1.41) = max(S - 103.9, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 103.9, 0.048, 0.15, 1.41\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0351", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.3$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.08e-06$, temporary impact is $\\eta = 2.51e-05$, and trader risk aversion is $\\lambda = 7.40e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.40e-06 \\times 0.09}{2.51e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.3) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.4e-06 * 0.09 / 2.51e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.3, 2.51e-05, 7.4e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0352", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 95.38$, paying a known discrete dividend $D = 1.62$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 105.95$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 95.38$, $D e^{-r t_D} = 1.58$, and $K e^{-r T} = 100.7828$.\nTheoretical difference $C_0 - P_0 = 95.38 - 1.58 - 100.7828 = -6.9828$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -6.9828, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 95.38, 105.95, 1.62, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -6.9828, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0353", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.016$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.2$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.2) * q, dxi/dt = (xi^2 - 0.016*xi) / 1.2, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.2, 0.016, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0354", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 5.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.2750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0355", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.58$, $\\sigma_1 = 0.208$, and $\\sigma_2 = 0.239$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.12979 S_t^3 V_t + 0.0865 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.12979*S^3*V + 0.0865*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.12979 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 121.99, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.58 * dW1 + np.sqrt(1 - 0.58**2) * dZ\ndS = 0.088 * S0 * dt + 0.208 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.239 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.088*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.12979*S0**3*V0 + 0.0865*S0**3*np.sqrt(V0))*dt + 3*0.208*S0**3*V0*dW1 + 0.239*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0356", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.074$ and volatility $\\sigma = 0.331$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 110.0$ at maturity $T = 0.72$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 110.0, 0)$.", "ground_truth_answer": "dV/dt + 0.074*S*dV/dS + 0.5*0.10956*S^2*d2V/dS2 - 0.074*V = 0, V(S, 0.72) = max(S - 110.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 110.0, 0.074, 0.331, 0.72\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0357", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 1.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.90e-06$, temporary impact is $\\eta = 1.90e-06$, and trader risk aversion is $\\lambda = 4.88e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{4.88e-05 \\times 0.09}{1.90e-06}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(1.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(4.88e-05 * 0.09 / 1.9e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 1.8, 1.9e-06, 4.88e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0358", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 96.92$, paying a known discrete dividend $D = 2.88$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 105.52$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 96.92$, $D e^{-r t_D} = 2.8089$, and $K e^{-r T} = 100.3737$.\nTheoretical difference $C_0 - P_0 = 96.92 - 2.8089 - 100.3737 = -6.2626$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -6.2626, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 96.92, 105.52, 2.88, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -6.2626, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0359", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.031$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.63$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.63) * q, dxi/dt = (xi^2 - 0.031*xi) / 0.63, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.63, 0.031, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0360", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 2.7$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{2.7}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.6750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 2.7\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0361", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.48$, $\\sigma_1 = 0.214$, and $\\sigma_2 = 0.295$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.13739 S_t^3 V_t + -0.09091 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.13739*S^3*V + -0.09091*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.13739 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 173.68, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.48 * dW1 + np.sqrt(1 - -0.48**2) * dZ\ndS = 0.0686 * S0 * dt + 0.214 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.295 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0686*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.13739*S0**3*V0 + -0.09091*S0**3*np.sqrt(V0))*dt + 3*0.214*S0**3*V0*dW1 + 0.295*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0362", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.068$ and volatility $\\sigma = 0.2$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 86.7$ at maturity $T = 0.66$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 86.7, 0)$.", "ground_truth_answer": "dV/dt + 0.068*S*dV/dS + 0.5*0.04000*S^2*d2V/dS2 - 0.068*V = 0, V(S, 0.66) = max(S - 86.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 86.7, 0.068, 0.2, 0.66\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0363", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 3.5$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 7.10e-07$, temporary impact is $\\eta = 4.49e-05$, and trader risk aversion is $\\lambda = 5.99e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.99e-05 \\times 0.09}{4.49e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(3.5) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.99e-05 * 0.09 / 4.49e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 3.5, 4.49e-05, 5.99e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0364", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 102.26$, paying a known discrete dividend $D = 2.87$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 95.98$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 102.26$, $D e^{-r t_D} = 2.7991$, and $K e^{-r T} = 91.299$.\nTheoretical difference $C_0 - P_0 = 102.26 - 2.7991 - 91.299 = 8.1619$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 8.1619)$.", "ground_truth_answer": "C0 - P0 = 8.1619, Lower bound = 8.1619", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 102.26, 95.98, 2.87, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 8.1619, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0365", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.035$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.68$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.68) * q, dxi/dt = (xi^2 - 0.035*xi) / 1.68, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.68, 0.035, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0366", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 8.5$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.5}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.1250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.5\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0367", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.08$, $\\sigma_1 = 0.26$, and $\\sigma_2 = 0.263$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0676 S_t^2 V_t + -0.01094 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0676*S^2*V + -0.01094*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0676 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 62.02, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.08 * dW1 + np.sqrt(1 - -0.08**2) * dZ\ndS = 0.1116 * S0 * dt + 0.26 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.263 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1116*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0676*S0**2*V0 + -0.01094*S0**2*np.sqrt(V0))*dt + 2*0.26*S0**2*V0*dW1 + 0.263*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0368", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.022$ and volatility $\\sigma = 0.191$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 97.5$ at maturity $T = 1.59$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 97.5, 0)$.", "ground_truth_answer": "dV/dt + 0.022*S*dV/dS + 0.5*0.03648*S^2*d2V/dS2 - 0.022*V = 0, V(S, 1.59) = max(S - 97.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 97.5, 0.022, 0.191, 1.59\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0369", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 2.3$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.29e-06$, temporary impact is $\\eta = 2.45e-05$, and trader risk aversion is $\\lambda = 6.20e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.20e-05 \\times 0.09}{2.45e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(2.3) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.2e-05 * 0.09 / 2.45e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 2.3, 2.45e-05, 6.2e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0370", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 99.40$, paying a known discrete dividend $D = 2.74$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 104.89$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 99.4$, $D e^{-r t_D} = 2.6723$, and $K e^{-r T} = 99.7745$.\nTheoretical difference $C_0 - P_0 = 99.4 - 2.6723 - 99.7745 = -3.0468$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -3.0468, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 99.4, 104.89, 2.74, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -3.0468, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0371", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.036$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.25$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.25) * q, dxi/dt = (xi^2 - 0.036*xi) / 1.25, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.25, 0.036, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0372", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 2.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{2.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.5500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 2.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0373", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.67$, $\\sigma_1 = 0.258$, and $\\sigma_2 = 0.199$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.06656 S_t^2 V_t + -0.0688 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.06656*S^2*V + -0.0688*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.06656 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 147.99, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.67 * dW1 + np.sqrt(1 - -0.67**2) * dZ\ndS = 0.0666 * S0 * dt + 0.258 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.199 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0666*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.06656*S0**2*V0 + -0.0688*S0**2*np.sqrt(V0))*dt + 2*0.258*S0**2*V0*dW1 + 0.199*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0374", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.061$ and volatility $\\sigma = 0.168$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 81.2$ at maturity $T = 0.89$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 81.2, 0)$.", "ground_truth_answer": "dV/dt + 0.061*S*dV/dS + 0.5*0.02822*S^2*d2V/dS2 - 0.061*V = 0, V(S, 0.89) = max(S - 81.2, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 81.2, 0.061, 0.168, 0.89\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0375", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 2.7$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.35e-06$, temporary impact is $\\eta = 3.66e-05$, and trader risk aversion is $\\lambda = 7.45e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.45e-05 \\times 0.09}{3.66e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(2.7) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.45e-05 * 0.09 / 3.66e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 2.7, 3.66e-05, 7.45e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0376", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 96.92$, paying a known discrete dividend $D = 2.98$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 97.42$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 96.92$, $D e^{-r t_D} = 2.9064$, and $K e^{-r T} = 92.6688$.\nTheoretical difference $C_0 - P_0 = 96.92 - 2.9064 - 92.6688 = 1.3448$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 1.3448)$.", "ground_truth_answer": "C0 - P0 = 1.3448, Lower bound = 1.3448", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 96.92, 97.42, 2.98, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 1.3448, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0377", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.045$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.37$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.37) * q, dxi/dt = (xi^2 - 0.045*xi) / 1.37, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.37, 0.045, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0378", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 7.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.9500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0379", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.36$, $\\sigma_1 = 0.33$, and $\\sigma_2 = 0.184$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.1089 S_t^2 V_t + -0.04372 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.1089*S^2*V + -0.04372*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.1089 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 123.0, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.36 * dW1 + np.sqrt(1 - -0.36**2) * dZ\ndS = 0.1099 * S0 * dt + 0.33 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.184 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1099*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.1089*S0**2*V0 + -0.04372*S0**2*np.sqrt(V0))*dt + 2*0.33*S0**2*V0*dW1 + 0.184*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0380", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.037$ and volatility $\\sigma = 0.24$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 95.4$ at maturity $T = 1.2$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 95.4, 0)$.", "ground_truth_answer": "dV/dt + 0.037*S*dV/dS + 0.5*0.05760*S^2*d2V/dS2 - 0.037*V = 0, V(S, 1.2) = max(S - 95.4, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 95.4, 0.037, 0.24, 1.2\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0381", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 4.6$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.69e-06$, temporary impact is $\\eta = 7.40e-06$, and trader risk aversion is $\\lambda = 7.19e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.19e-05 \\times 0.09}{7.40e-06}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(4.6) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.19e-05 * 0.09 / 7.4e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 4.6, 7.4e-06, 7.19e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0382", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 93.59$, paying a known discrete dividend $D = 2.94$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 94.75$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 93.59$, $D e^{-r t_D} = 2.8674$, and $K e^{-r T} = 90.129$.\nTheoretical difference $C_0 - P_0 = 93.59 - 2.8674 - 90.129 = 0.5936$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.5936)$.", "ground_truth_answer": "C0 - P0 = 0.5936, Lower bound = 0.5936", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 93.59, 94.75, 2.94, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 0.5936, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0383", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.027$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.6$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.6) * q, dxi/dt = (xi^2 - 0.027*xi) / 0.6, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.6, 0.027, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0384", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 4.0$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.0}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.0000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.0\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0385", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.15$, $\\sigma_1 = 0.253$, and $\\sigma_2 = 0.172$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.19203 S_t^3 V_t + 0.01958 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.19203*S^3*V + 0.01958*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.19203 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 180.61, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.15 * dW1 + np.sqrt(1 - 0.15**2) * dZ\ndS = 0.0756 * S0 * dt + 0.253 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.172 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0756*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.19203*S0**3*V0 + 0.01958*S0**3*np.sqrt(V0))*dt + 3*0.253*S0**3*V0*dW1 + 0.172*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0386", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.059$ and volatility $\\sigma = 0.228$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 96.0$ at maturity $T = 1.79$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 96.0, 0)$.", "ground_truth_answer": "dV/dt + 0.059*S*dV/dS + 0.5*0.05198*S^2*d2V/dS2 - 0.059*V = 0, V(S, 1.79) = max(S - 96.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 96.0, 0.059, 0.228, 1.79\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0387", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 4.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.69e-06$, temporary impact is $\\eta = 3.89e-05$, and trader risk aversion is $\\lambda = 1.40e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.40e-05 \\times 0.09}{3.89e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(4.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1.4e-05 * 0.09 / 3.89e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 4.9, 3.89e-05, 1.4e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0388", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 99.08$, paying a known discrete dividend $D = 1.15$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 94.72$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 99.08$, $D e^{-r t_D} = 1.1216$, and $K e^{-r T} = 90.1005$.\nTheoretical difference $C_0 - P_0 = 99.08 - 1.1216 - 90.1005 = 7.8579$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 7.8579)$.", "ground_truth_answer": "C0 - P0 = 7.8579, Lower bound = 7.8579", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 99.08, 94.72, 1.15, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 7.8579, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0389", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.023$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.17$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.17) * q, dxi/dt = (xi^2 - 0.023*xi) / 1.17, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.17, 0.023, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0390", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 3.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.8000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0391", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.23$, $\\sigma_1 = 0.34$, and $\\sigma_2 = 0.151$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.3468 S_t^3 V_t + -0.03542 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.3468*S^3*V + -0.03542*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.3468 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 117.42, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.23 * dW1 + np.sqrt(1 - -0.23**2) * dZ\ndS = 0.087 * S0 * dt + 0.34 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.151 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.087*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.3468*S0**3*V0 + -0.03542*S0**3*np.sqrt(V0))*dt + 3*0.34*S0**3*V0*dW1 + 0.151*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0392", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.022$ and volatility $\\sigma = 0.334$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 106.6$ at maturity $T = 1.21$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 106.6, 0)$.", "ground_truth_answer": "dV/dt + 0.022*S*dV/dS + 0.5*0.11156*S^2*d2V/dS2 - 0.022*V = 0, V(S, 1.21) = max(S - 106.6, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 106.6, 0.022, 0.334, 1.21\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0393", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.2$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.56e-06$, temporary impact is $\\eta = 2.29e-05$, and trader risk aversion is $\\lambda = 8.66e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{8.66e-05 \\times 0.09}{2.29e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.2) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(8.66e-05 * 0.09 / 2.29e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.2, 2.29e-05, 8.66e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0394", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 100.80$, paying a known discrete dividend $D = 2.97$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 90.68$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 100.8$, $D e^{-r t_D} = 2.8967$, and $K e^{-r T} = 86.2575$.\nTheoretical difference $C_0 - P_0 = 100.8 - 2.8967 - 86.2575 = 11.6458$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 11.6458)$.", "ground_truth_answer": "C0 - P0 = 11.6458, Lower bound = 11.6458", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 100.8, 90.68, 2.97, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 11.6458, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0395", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.031$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.9$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.9) * q, dxi/dt = (xi^2 - 0.031*xi) / 1.9, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.9, 0.031, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0396", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 7.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.7750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0397", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.14$, $\\sigma_1 = 0.168$, and $\\sigma_2 = 0.121$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.08467 S_t^3 V_t + 0.00854 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.08467*S^3*V + 0.00854*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.08467 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 83.71, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.14 * dW1 + np.sqrt(1 - 0.14**2) * dZ\ndS = 0.0544 * S0 * dt + 0.168 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.121 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0544*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.08467*S0**3*V0 + 0.00854*S0**3*np.sqrt(V0))*dt + 3*0.168*S0**3*V0*dW1 + 0.121*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0398", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.029$ and volatility $\\sigma = 0.397$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 118.6$ at maturity $T = 0.51$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 118.6, 0)$.", "ground_truth_answer": "dV/dt + 0.029*S*dV/dS + 0.5*0.15761*S^2*d2V/dS2 - 0.029*V = 0, V(S, 0.51) = max(S - 118.6, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 118.6, 0.029, 0.397, 0.51\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0399", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 2.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.68e-06$, temporary impact is $\\eta = 4.87e-05$, and trader risk aversion is $\\lambda = 5.84e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.84e-05 \\times 0.09}{4.87e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(2.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.84e-05 * 0.09 / 4.87e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 2.0, 4.87e-05, 5.84e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0400", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 100.43$, paying a known discrete dividend $D = 2.06$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 96.85$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 100.43$, $D e^{-r t_D} = 2.0091$, and $K e^{-r T} = 92.1266$.\nTheoretical difference $C_0 - P_0 = 100.43 - 2.0091 - 92.1266 = 6.2943$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 6.2943)$.", "ground_truth_answer": "C0 - P0 = 6.2943, Lower bound = 6.2943", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 100.43, 96.85, 2.06, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 6.2943, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0401", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.011$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.96$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.96) * q, dxi/dt = (xi^2 - 0.011*xi) / 0.96, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.96, 0.011, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0402", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 3.6$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.6}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.9000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.6\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0403", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.09$, $\\sigma_1 = 0.169$, and $\\sigma_2 = 0.235$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.02856 S_t^2 V_t + -0.00715 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.02856*S^2*V + -0.00715*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.02856 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 151.01, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.09 * dW1 + np.sqrt(1 - -0.09**2) * dZ\ndS = 0.1176 * S0 * dt + 0.169 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.235 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1176*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.02856*S0**2*V0 + -0.00715*S0**2*np.sqrt(V0))*dt + 2*0.169*S0**2*V0*dW1 + 0.235*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0404", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.078$ and volatility $\\sigma = 0.214$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 106.5$ at maturity $T = 1.97$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 106.5, 0)$.", "ground_truth_answer": "dV/dt + 0.078*S*dV/dS + 0.5*0.04580*S^2*d2V/dS2 - 0.078*V = 0, V(S, 1.97) = max(S - 106.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 106.5, 0.078, 0.214, 1.97\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0405", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 4.5$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.45e-06$, temporary impact is $\\eta = 2.54e-05$, and trader risk aversion is $\\lambda = 6.22e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.22e-05 \\times 0.09}{2.54e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(4.5) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.22e-05 * 0.09 / 2.54e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 4.5, 2.54e-05, 6.22e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0406", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 101.41$, paying a known discrete dividend $D = 2.86$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 90.61$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 101.41$, $D e^{-r t_D} = 2.7894$, and $K e^{-r T} = 86.1909$.\nTheoretical difference $C_0 - P_0 = 101.41 - 2.7894 - 86.1909 = 12.4297$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 12.4297)$.", "ground_truth_answer": "C0 - P0 = 12.4297, Lower bound = 12.4297", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 101.41, 90.61, 2.86, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 12.4297, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0407", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.047$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.4$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.4) * q, dxi/dt = (xi^2 - 0.047*xi) / 1.4, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.4, 0.047, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0408", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 7.3$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.3}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.8250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.3\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0409", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.8$, $\\sigma_1 = 0.171$, and $\\sigma_2 = 0.232$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.08772 S_t^3 V_t + 0.09521 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.08772*S^3*V + 0.09521*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.08772 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 109.08, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.8 * dW1 + np.sqrt(1 - 0.8**2) * dZ\ndS = 0.0921 * S0 * dt + 0.171 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.232 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0921*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.08772*S0**3*V0 + 0.09521*S0**3*np.sqrt(V0))*dt + 3*0.171*S0**3*V0*dW1 + 0.232*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0410", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.039$ and volatility $\\sigma = 0.367$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 119.7$ at maturity $T = 1.63$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 119.7, 0)$.", "ground_truth_answer": "dV/dt + 0.039*S*dV/dS + 0.5*0.13469*S^2*d2V/dS2 - 0.039*V = 0, V(S, 1.63) = max(S - 119.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 119.7, 0.039, 0.367, 1.63\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0411", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 2.6$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.88e-06$, temporary impact is $\\eta = 3.72e-05$, and trader risk aversion is $\\lambda = 8.80e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{8.80e-05 \\times 0.09}{3.72e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(2.6) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(8.8e-05 * 0.09 / 3.72e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 2.6, 3.72e-05, 8.8e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0412", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 96.54$, paying a known discrete dividend $D = 2.62$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 103.35$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 96.54$, $D e^{-r t_D} = 2.5553$, and $K e^{-r T} = 98.3096$.\nTheoretical difference $C_0 - P_0 = 96.54 - 2.5553 - 98.3096 = -4.3249$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -4.3249, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 96.54, 103.35, 2.62, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -4.3249, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0413", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.045$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.98$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.98) * q, dxi/dt = (xi^2 - 0.045*xi) / 0.98, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.98, 0.045, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0414", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 8.5$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.5}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.1250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.5\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0415", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.21$, $\\sigma_1 = 0.151$, and $\\sigma_2 = 0.165$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0228 S_t^2 V_t + -0.01046 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0228*S^2*V + -0.01046*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0228 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 68.03, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.21 * dW1 + np.sqrt(1 - -0.21**2) * dZ\ndS = 0.0836 * S0 * dt + 0.151 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.165 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0836*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0228*S0**2*V0 + -0.01046*S0**2*np.sqrt(V0))*dt + 2*0.151*S0**2*V0*dW1 + 0.165*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0416", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.054$ and volatility $\\sigma = 0.245$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 101.9$ at maturity $T = 1.39$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 101.9, 0)$.", "ground_truth_answer": "dV/dt + 0.054*S*dV/dS + 0.5*0.06002*S^2*d2V/dS2 - 0.054*V = 0, V(S, 1.39) = max(S - 101.9, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 101.9, 0.054, 0.245, 1.39\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0417", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 1.7$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.28e-06$, temporary impact is $\\eta = 1.70e-06$, and trader risk aversion is $\\lambda = 5.91e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.91e-05 \\times 0.09}{1.70e-06}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(1.7) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.91e-05 * 0.09 / 1.7e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 1.7, 1.7e-06, 5.91e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0418", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 102.85$, paying a known discrete dividend $D = 2.00$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 105.19$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 102.85$, $D e^{-r t_D} = 1.9506$, and $K e^{-r T} = 100.0598$.\nTheoretical difference $C_0 - P_0 = 102.85 - 1.9506 - 100.0598 = 0.8396$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.8396)$.", "ground_truth_answer": "C0 - P0 = 0.8396, Lower bound = 0.8396", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 102.85, 105.19, 2.0, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 0.8396, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0419", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.045$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.28$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.28) * q, dxi/dt = (xi^2 - 0.045*xi) / 1.28, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.28, 0.045, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0420", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 9.3$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.3}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.3250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.3\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0421", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.41$, $\\sigma_1 = 0.18$, and $\\sigma_2 = 0.205$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.0972 S_t^3 V_t + -0.04539 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.0972*S^3*V + -0.04539*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.0972 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 172.06, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.41 * dW1 + np.sqrt(1 - -0.41**2) * dZ\ndS = 0.0487 * S0 * dt + 0.18 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.205 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0487*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.0972*S0**3*V0 + -0.04539*S0**3*np.sqrt(V0))*dt + 3*0.18*S0**3*V0*dW1 + 0.205*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0422", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.056$ and volatility $\\sigma = 0.341$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 112.5$ at maturity $T = 1.58$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 112.5, 0)$.", "ground_truth_answer": "dV/dt + 0.056*S*dV/dS + 0.5*0.11628*S^2*d2V/dS2 - 0.056*V = 0, V(S, 1.58) = max(S - 112.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 112.5, 0.056, 0.341, 1.58\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0423", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 4.6$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.65e-06$, temporary impact is $\\eta = 4.13e-05$, and trader risk aversion is $\\lambda = 4.37e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{4.37e-05 \\times 0.09}{4.13e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(4.6) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(4.37e-05 * 0.09 / 4.13e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 4.6, 4.13e-05, 4.37e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0424", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 91.43$, paying a known discrete dividend $D = 2.31$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 109.09$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 91.43$, $D e^{-r t_D} = 2.253$, and $K e^{-r T} = 103.7696$.\nTheoretical difference $C_0 - P_0 = 91.43 - 2.253 - 103.7696 = -14.5926$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -14.5926, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 91.43, 109.09, 2.31, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -14.5926, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0425", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.012$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.9$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.9) * q, dxi/dt = (xi^2 - 0.012*xi) / 1.9, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.9, 0.012, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0426", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 3.6$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.6}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.9000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.6\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0427", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.69$, $\\sigma_1 = 0.255$, and $\\sigma_2 = 0.234$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.19508 S_t^3 V_t + 0.12352 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.19508*S^3*V + 0.12352*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.19508 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 74.95, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.69 * dW1 + np.sqrt(1 - 0.69**2) * dZ\ndS = 0.0894 * S0 * dt + 0.255 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.234 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0894*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.19508*S0**3*V0 + 0.12352*S0**3*np.sqrt(V0))*dt + 3*0.255*S0**3*V0*dW1 + 0.234*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0428", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.052$ and volatility $\\sigma = 0.228$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 104.4$ at maturity $T = 1.57$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 104.4, 0)$.", "ground_truth_answer": "dV/dt + 0.052*S*dV/dS + 0.5*0.05198*S^2*d2V/dS2 - 0.052*V = 0, V(S, 1.57) = max(S - 104.4, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 104.4, 0.052, 0.228, 1.57\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0429", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 1.5$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.89e-06$, temporary impact is $\\eta = 4.13e-05$, and trader risk aversion is $\\lambda = 5.27e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.27e-05 \\times 0.09}{4.13e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(1.5) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.27e-05 * 0.09 / 4.13e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 1.5, 4.13e-05, 5.27e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0430", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 107.19$, paying a known discrete dividend $D = 1.37$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 106.00$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 107.19$, $D e^{-r t_D} = 1.3362$, and $K e^{-r T} = 100.8303$.\nTheoretical difference $C_0 - P_0 = 107.19 - 1.3362 - 100.8303 = 5.0235$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 5.0235)$.", "ground_truth_answer": "C0 - P0 = 5.0235, Lower bound = 5.0235", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 107.19, 106.0, 1.37, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 5.0235, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0431", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.014$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.35$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.35) * q, dxi/dt = (xi^2 - 0.014*xi) / 1.35, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.35, 0.014, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0432", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 9.3$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.3}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.3250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.3\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0433", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.04$, $\\sigma_1 = 0.313$, and $\\sigma_2 = 0.175$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09797 S_t^2 V_t + 0.00438 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.09797*S^2*V + 0.00438*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09797 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 113.68, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.04 * dW1 + np.sqrt(1 - 0.04**2) * dZ\ndS = 0.047 * S0 * dt + 0.313 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.175 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.047*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.09797*S0**2*V0 + 0.00438*S0**2*np.sqrt(V0))*dt + 2*0.313*S0**2*V0*dW1 + 0.175*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0434", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.077$ and volatility $\\sigma = 0.3$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 112.8$ at maturity $T = 1.83$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 112.8, 0)$.", "ground_truth_answer": "dV/dt + 0.077*S*dV/dS + 0.5*0.09000*S^2*d2V/dS2 - 0.077*V = 0, V(S, 1.83) = max(S - 112.8, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 112.8, 0.077, 0.3, 1.83\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0435", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 2.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.99e-06$, temporary impact is $\\eta = 3.27e-05$, and trader risk aversion is $\\lambda = 1.83e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.83e-05 \\times 0.09}{3.27e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(2.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1.83e-05 * 0.09 / 3.27e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 2.4, 3.27e-05, 1.83e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0436", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 108.12$, paying a known discrete dividend $D = 2.11$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 105.40$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 108.12$, $D e^{-r t_D} = 2.0579$, and $K e^{-r T} = 100.2596$.\nTheoretical difference $C_0 - P_0 = 108.12 - 2.0579 - 100.2596 = 5.8025$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 5.8025)$.", "ground_truth_answer": "C0 - P0 = 5.8025, Lower bound = 5.8025", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 108.12, 105.4, 2.11, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 5.8025, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0437", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.041$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.91$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.91) * q, dxi/dt = (xi^2 - 0.041*xi) / 0.91, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.91, 0.041, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0438", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 8.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.2000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0439", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.12$, $\\sigma_1 = 0.303$, and $\\sigma_2 = 0.13$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09181 S_t^2 V_t + -0.00945 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.09181*S^2*V + -0.00945*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09181 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 150.71, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.12 * dW1 + np.sqrt(1 - -0.12**2) * dZ\ndS = 0.1048 * S0 * dt + 0.303 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.13 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1048*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.09181*S0**2*V0 + -0.00945*S0**2*np.sqrt(V0))*dt + 2*0.303*S0**2*V0*dW1 + 0.13*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0440", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.03$ and volatility $\\sigma = 0.334$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 114.5$ at maturity $T = 0.83$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 114.5, 0)$.", "ground_truth_answer": "dV/dt + 0.03*S*dV/dS + 0.5*0.11156*S^2*d2V/dS2 - 0.03*V = 0, V(S, 0.83) = max(S - 114.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 114.5, 0.03, 0.334, 0.83\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0441", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 1.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 9.70e-07$, temporary impact is $\\eta = 1.63e-05$, and trader risk aversion is $\\lambda = 2.38e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{2.38e-05 \\times 0.09}{1.63e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(1.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(2.38e-05 * 0.09 / 1.63e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 1.8, 1.63e-05, 2.38e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0442", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 102.76$, paying a known discrete dividend $D = 2.26$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 95.14$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 102.76$, $D e^{-r t_D} = 2.2042$, and $K e^{-r T} = 90.5$.\nTheoretical difference $C_0 - P_0 = 102.76 - 2.2042 - 90.5 = 10.0558$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 10.0558)$.", "ground_truth_answer": "C0 - P0 = 10.0558, Lower bound = 10.0558", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 102.76, 95.14, 2.26, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 10.0558, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0443", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.03$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.98$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.98) * q, dxi/dt = (xi^2 - 0.03*xi) / 1.98, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.98, 0.03, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0444", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 6.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.7000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0445", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.77$, $\\sigma_1 = 0.239$, and $\\sigma_2 = 0.245$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.17136 S_t^3 V_t + -0.13526 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.17136*S^3*V + -0.13526*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.17136 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 151.38, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.77 * dW1 + np.sqrt(1 - -0.77**2) * dZ\ndS = 0.0754 * S0 * dt + 0.239 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.245 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0754*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.17136*S0**3*V0 + -0.13526*S0**3*np.sqrt(V0))*dt + 3*0.239*S0**3*V0*dW1 + 0.245*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0446", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.028$ and volatility $\\sigma = 0.176$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 109.0$ at maturity $T = 1.37$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 109.0, 0)$.", "ground_truth_answer": "dV/dt + 0.028*S*dV/dS + 0.5*0.03098*S^2*d2V/dS2 - 0.028*V = 0, V(S, 1.37) = max(S - 109.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 109.0, 0.028, 0.176, 1.37\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0447", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 3.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.89e-06$, temporary impact is $\\eta = 1.40e-05$, and trader risk aversion is $\\lambda = 6.49e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.49e-05 \\times 0.09}{1.40e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(3.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.49e-05 * 0.09 / 1.4e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 3.4, 1.4e-05, 6.49e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0448", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 98.02$, paying a known discrete dividend $D = 1.69$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 97.34$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 98.02$, $D e^{-r t_D} = 1.6483$, and $K e^{-r T} = 92.5927$.\nTheoretical difference $C_0 - P_0 = 98.02 - 1.6483 - 92.5927 = 3.7790$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 3.7790)$.", "ground_truth_answer": "C0 - P0 = 3.7790, Lower bound = 3.7790", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 98.02, 97.34, 1.69, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 3.779, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0449", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.013$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.28$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.28) * q, dxi/dt = (xi^2 - 0.013*xi) / 1.28, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.28, 0.013, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0450", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 7.4$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.4}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.8500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.4\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0451", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.29$, $\\sigma_1 = 0.204$, and $\\sigma_2 = 0.219$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.12485 S_t^3 V_t + 0.03887 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.12485*S^3*V + 0.03887*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.12485 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 60.49, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.29 * dW1 + np.sqrt(1 - 0.29**2) * dZ\ndS = 0.0912 * S0 * dt + 0.204 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.219 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0912*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.12485*S0**3*V0 + 0.03887*S0**3*np.sqrt(V0))*dt + 3*0.204*S0**3*V0*dW1 + 0.219*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0452", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.039$ and volatility $\\sigma = 0.233$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 106.8$ at maturity $T = 1.99$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 106.8, 0)$.", "ground_truth_answer": "dV/dt + 0.039*S*dV/dS + 0.5*0.05429*S^2*d2V/dS2 - 0.039*V = 0, V(S, 1.99) = max(S - 106.8, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 106.8, 0.039, 0.233, 1.99\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0453", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 2.3$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.88e-06$, temporary impact is $\\eta = 4.98e-05$, and trader risk aversion is $\\lambda = 4.52e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{4.52e-05 \\times 0.09}{4.98e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(2.3) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(4.52e-05 * 0.09 / 4.98e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 2.3, 4.98e-05, 4.52e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0454", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 101.61$, paying a known discrete dividend $D = 2.92$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 91.78$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 101.61$, $D e^{-r t_D} = 2.8479$, and $K e^{-r T} = 87.3038$.\nTheoretical difference $C_0 - P_0 = 101.61 - 2.8479 - 87.3038 = 11.4583$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 11.4583)$.", "ground_truth_answer": "C0 - P0 = 11.4583, Lower bound = 11.4583", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 101.61, 91.78, 2.92, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 11.4583, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0455", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.038$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.8$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.8) * q, dxi/dt = (xi^2 - 0.038*xi) / 0.8, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.8, 0.038, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0456", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 2.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{2.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.7000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 2.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0457", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.47$, $\\sigma_1 = 0.22$, and $\\sigma_2 = 0.233$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.1452 S_t^3 V_t + 0.07228 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.1452*S^3*V + 0.07228*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.1452 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 117.56, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.47 * dW1 + np.sqrt(1 - 0.47**2) * dZ\ndS = 0.1005 * S0 * dt + 0.22 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.233 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.1005*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.1452*S0**3*V0 + 0.07228*S0**3*np.sqrt(V0))*dt + 3*0.22*S0**3*V0*dW1 + 0.233*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0458", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.043$ and volatility $\\sigma = 0.18$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 119.0$ at maturity $T = 0.53$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 119.0, 0)$.", "ground_truth_answer": "dV/dt + 0.043*S*dV/dS + 0.5*0.03240*S^2*d2V/dS2 - 0.043*V = 0, V(S, 0.53) = max(S - 119.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 119.0, 0.043, 0.18, 0.53\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0459", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 1.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.23e-06$, temporary impact is $\\eta = 2.65e-05$, and trader risk aversion is $\\lambda = 6.27e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.27e-05 \\times 0.09}{2.65e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(1.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.27e-05 * 0.09 / 2.65e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 1.4, 2.65e-05, 6.27e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0460", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 105.11$, paying a known discrete dividend $D = 2.65$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 92.55$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 105.11$, $D e^{-r t_D} = 2.5846$, and $K e^{-r T} = 88.0363$.\nTheoretical difference $C_0 - P_0 = 105.11 - 2.5846 - 88.0363 = 14.4891$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 14.4891)$.", "ground_truth_answer": "C0 - P0 = 14.4891, Lower bound = 14.4891", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 105.11, 92.55, 2.65, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 14.4891, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0461", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.016$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.59$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.59) * q, dxi/dt = (xi^2 - 0.016*xi) / 0.59, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.59, 0.016, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0462", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 3.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.9500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0463", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.02$, $\\sigma_1 = 0.219$, and $\\sigma_2 = 0.148$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04796 S_t^2 V_t + 0.0013 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.04796*S^2*V + 0.0013*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04796 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 101.25, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.02 * dW1 + np.sqrt(1 - 0.02**2) * dZ\ndS = 0.0705 * S0 * dt + 0.219 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.148 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0705*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.04796*S0**2*V0 + 0.0013*S0**2*np.sqrt(V0))*dt + 2*0.219*S0**2*V0*dW1 + 0.148*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0464", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.044$ and volatility $\\sigma = 0.262$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 104.0$ at maturity $T = 1.27$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 104.0, 0)$.", "ground_truth_answer": "dV/dt + 0.044*S*dV/dS + 0.5*0.06864*S^2*d2V/dS2 - 0.044*V = 0, V(S, 1.27) = max(S - 104.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 104.0, 0.044, 0.262, 1.27\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0465", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 2.6$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.95e-06$, temporary impact is $\\eta = 2.92e-05$, and trader risk aversion is $\\lambda = 5.71e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.71e-05 \\times 0.09}{2.92e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(2.6) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.71e-05 * 0.09 / 2.92e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 2.6, 2.92e-05, 5.71e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0466", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 100.02$, paying a known discrete dividend $D = 2.08$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 97.94$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 100.02$, $D e^{-r t_D} = 2.0286$, and $K e^{-r T} = 93.1634$.\nTheoretical difference $C_0 - P_0 = 100.02 - 2.0286 - 93.1634 = 4.8280$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 4.8280)$.", "ground_truth_answer": "C0 - P0 = 4.8280, Lower bound = 4.8280", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 100.02, 97.94, 2.08, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 4.828, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0467", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.025$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.82$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.82) * q, dxi/dt = (xi^2 - 0.025*xi) / 1.82, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.82, 0.025, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0468", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 7.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.9500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0469", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.76$, $\\sigma_1 = 0.314$, and $\\sigma_2 = 0.165$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0986 S_t^2 V_t + -0.07875 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0986*S^2*V + -0.07875*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0986 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 71.19, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.76 * dW1 + np.sqrt(1 - -0.76**2) * dZ\ndS = 0.057 * S0 * dt + 0.314 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.165 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.057*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0986*S0**2*V0 + -0.07875*S0**2*np.sqrt(V0))*dt + 2*0.314*S0**2*V0*dW1 + 0.165*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0470", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.062$ and volatility $\\sigma = 0.237$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 119.0$ at maturity $T = 1.46$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 119.0, 0)$.", "ground_truth_answer": "dV/dt + 0.062*S*dV/dS + 0.5*0.05617*S^2*d2V/dS2 - 0.062*V = 0, V(S, 1.46) = max(S - 119.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 119.0, 0.062, 0.237, 1.46\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0471", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.92e-06$, temporary impact is $\\eta = 2.45e-05$, and trader risk aversion is $\\lambda = 3.21e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.21e-05 \\times 0.09}{2.45e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.21e-05 * 0.09 / 2.45e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.4, 2.45e-05, 3.21e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0472", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 92.78$, paying a known discrete dividend $D = 2.66$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 107.97$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 92.78$, $D e^{-r t_D} = 2.5943$, and $K e^{-r T} = 102.7042$.\nTheoretical difference $C_0 - P_0 = 92.78 - 2.5943 - 102.7042 = -12.5185$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -12.5185, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 92.78, 107.97, 2.66, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -12.5185, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0473", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.048$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.74$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.74) * q, dxi/dt = (xi^2 - 0.048*xi) / 1.74, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.74, 0.048, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0474", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 4.9$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.9}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.2250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.9\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0475", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.08$, $\\sigma_1 = 0.177$, and $\\sigma_2 = 0.293$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.09399 S_t^3 V_t + 0.01245 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.09399*S^3*V + 0.01245*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.09399 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 60.23, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.08 * dW1 + np.sqrt(1 - 0.08**2) * dZ\ndS = 0.0421 * S0 * dt + 0.177 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.293 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0421*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.09399*S0**3*V0 + 0.01245*S0**3*np.sqrt(V0))*dt + 3*0.177*S0**3*V0*dW1 + 0.293*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0476", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.027$ and volatility $\\sigma = 0.299$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 117.5$ at maturity $T = 1.81$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 117.5, 0)$.", "ground_truth_answer": "dV/dt + 0.027*S*dV/dS + 0.5*0.08940*S^2*d2V/dS2 - 0.027*V = 0, V(S, 1.81) = max(S - 117.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 117.5, 0.027, 0.299, 1.81\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0477", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.5$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 6.20e-07$, temporary impact is $\\eta = 3.24e-05$, and trader risk aversion is $\\lambda = 2.24e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{2.24e-05 \\times 0.09}{3.24e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.5) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(2.24e-05 * 0.09 / 3.24e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.5, 3.24e-05, 2.24e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0478", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 103.00$, paying a known discrete dividend $D = 1.12$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 93.04$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 103.0$, $D e^{-r t_D} = 1.0923$, and $K e^{-r T} = 88.5024$.\nTheoretical difference $C_0 - P_0 = 103.0 - 1.0923 - 88.5024 = 13.4053$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 13.4053)$.", "ground_truth_answer": "C0 - P0 = 13.4053, Lower bound = 13.4053", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 103.0, 93.04, 1.12, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 13.4053, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0479", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.018$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.82$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.82) * q, dxi/dt = (xi^2 - 0.018*xi) / 0.82, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.82, 0.018, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0480", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 10.0$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{10.0}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.5000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 10.0\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0481", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.57$, $\\sigma_1 = 0.347$, and $\\sigma_2 = 0.148$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.12041 S_t^2 V_t + -0.05855 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.12041*S^2*V + -0.05855*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.12041 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 58.67, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.57 * dW1 + np.sqrt(1 - -0.57**2) * dZ\ndS = 0.0956 * S0 * dt + 0.347 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.148 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0956*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.12041*S0**2*V0 + -0.05855*S0**2*np.sqrt(V0))*dt + 2*0.347*S0**2*V0*dW1 + 0.148*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0482", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.067$ and volatility $\\sigma = 0.216$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 87.1$ at maturity $T = 1.54$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 87.1, 0)$.", "ground_truth_answer": "dV/dt + 0.067*S*dV/dS + 0.5*0.04666*S^2*d2V/dS2 - 0.067*V = 0, V(S, 1.54) = max(S - 87.1, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 87.1, 0.067, 0.216, 1.54\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0483", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.5$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.60e-06$, temporary impact is $\\eta = 4.98e-05$, and trader risk aversion is $\\lambda = 8.16e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{8.16e-05 \\times 0.09}{4.98e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.5) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(8.16e-05 * 0.09 / 4.98e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.5, 4.98e-05, 8.16e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0484", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 96.13$, paying a known discrete dividend $D = 2.05$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 102.48$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 96.13$, $D e^{-r t_D} = 1.9994$, and $K e^{-r T} = 97.482$.\nTheoretical difference $C_0 - P_0 = 96.13 - 1.9994 - 97.482 = -3.3514$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -3.3514, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 96.13, 102.48, 2.05, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -3.3514, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0485", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.039$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.69$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.69) * q, dxi/dt = (xi^2 - 0.039*xi) / 1.69, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.69, 0.039, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0486", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 5.6$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.6}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.4000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.6\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0487", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.37$, $\\sigma_1 = 0.233$, and $\\sigma_2 = 0.266$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.16287 S_t^3 V_t + 0.0688 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.16287*S^3*V + 0.0688*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.16287 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 79.19, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.37 * dW1 + np.sqrt(1 - 0.37**2) * dZ\ndS = 0.0694 * S0 * dt + 0.233 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.266 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0694*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.16287*S0**3*V0 + 0.0688*S0**3*np.sqrt(V0))*dt + 3*0.233*S0**3*V0*dW1 + 0.266*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0488", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.078$ and volatility $\\sigma = 0.212$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 85.4$ at maturity $T = 1.13$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 85.4, 0)$.", "ground_truth_answer": "dV/dt + 0.078*S*dV/dS + 0.5*0.04494*S^2*d2V/dS2 - 0.078*V = 0, V(S, 1.13) = max(S - 85.4, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 85.4, 0.078, 0.212, 1.13\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0489", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 3.1$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.37e-06$, temporary impact is $\\eta = 3.83e-05$, and trader risk aversion is $\\lambda = 1.46e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.46e-05 \\times 0.09}{3.83e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(3.1) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1.46e-05 * 0.09 / 3.83e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 3.1, 3.83e-05, 1.46e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0490", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 94.30$, paying a known discrete dividend $D = 1.48$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 90.24$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 94.3$, $D e^{-r t_D} = 1.4435$, and $K e^{-r T} = 85.8389$.\nTheoretical difference $C_0 - P_0 = 94.3 - 1.4435 - 85.8389 = 7.0176$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 7.0176)$.", "ground_truth_answer": "C0 - P0 = 7.0176, Lower bound = 7.0176", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 94.3, 90.24, 1.48, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 7.0176, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0491", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.018$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.6$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.6) * q, dxi/dt = (xi^2 - 0.018*xi) / 0.6, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.6, 0.018, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0492", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 2.9$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{2.9}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.7250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 2.9\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0493", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.02$, $\\sigma_1 = 0.319$, and $\\sigma_2 = 0.12$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.30528 S_t^3 V_t + -0.0023 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.30528*S^3*V + -0.0023*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.30528 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 132.19, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.02 * dW1 + np.sqrt(1 - -0.02**2) * dZ\ndS = 0.0764 * S0 * dt + 0.319 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.12 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0764*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.30528*S0**3*V0 + -0.0023*S0**3*np.sqrt(V0))*dt + 3*0.319*S0**3*V0*dW1 + 0.12*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0494", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.072$ and volatility $\\sigma = 0.211$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 106.1$ at maturity $T = 1.72$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 106.1, 0)$.", "ground_truth_answer": "dV/dt + 0.072*S*dV/dS + 0.5*0.04452*S^2*d2V/dS2 - 0.072*V = 0, V(S, 1.72) = max(S - 106.1, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 106.1, 0.072, 0.211, 1.72\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0495", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 4.6$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.03e-06$, temporary impact is $\\eta = 2.35e-05$, and trader risk aversion is $\\lambda = 7.87e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.87e-05 \\times 0.09}{2.35e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(4.6) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.87e-05 * 0.09 / 2.35e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 4.6, 2.35e-05, 7.87e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0496", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 109.11$, paying a known discrete dividend $D = 1.63$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 105.74$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 109.11$, $D e^{-r t_D} = 1.5898$, and $K e^{-r T} = 100.583$.\nTheoretical difference $C_0 - P_0 = 109.11 - 1.5898 - 100.583 = 6.9372$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 6.9372)$.", "ground_truth_answer": "C0 - P0 = 6.9372, Lower bound = 6.9372", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 109.11, 105.74, 1.63, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 6.9372, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0497", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.042$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.61$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.61) * q, dxi/dt = (xi^2 - 0.042*xi) / 0.61, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.61, 0.042, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0498", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 8.7$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.7}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.1750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.7\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0499", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.25$, $\\sigma_1 = 0.242$, and $\\sigma_2 = 0.227$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.05856 S_t^2 V_t + 0.02747 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.05856*S^2*V + 0.02747*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.05856 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 55.76, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.25 * dW1 + np.sqrt(1 - 0.25**2) * dZ\ndS = 0.1121 * S0 * dt + 0.242 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.227 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1121*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.05856*S0**2*V0 + 0.02747*S0**2*np.sqrt(V0))*dt + 2*0.242*S0**2*V0*dW1 + 0.227*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0500", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.047$ and volatility $\\sigma = 0.207$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 115.6$ at maturity $T = 1.18$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 115.6, 0)$.", "ground_truth_answer": "dV/dt + 0.047*S*dV/dS + 0.5*0.04285*S^2*d2V/dS2 - 0.047*V = 0, V(S, 1.18) = max(S - 115.6, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 115.6, 0.047, 0.207, 1.18\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0501", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.7$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 8.40e-07$, temporary impact is $\\eta = 3.71e-05$, and trader risk aversion is $\\lambda = 5.17e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.17e-05 \\times 0.09}{3.71e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.7) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.17e-05 * 0.09 / 3.71e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.7, 3.71e-05, 5.17e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0502", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 90.83$, paying a known discrete dividend $D = 2.43$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 91.70$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 90.83$, $D e^{-r t_D} = 2.37$, and $K e^{-r T} = 87.2277$.\nTheoretical difference $C_0 - P_0 = 90.83 - 2.37 - 87.2277 = 1.2323$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 1.2323)$.", "ground_truth_answer": "C0 - P0 = 1.2323, Lower bound = 1.2323", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 90.83, 91.7, 2.43, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 1.2323, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0503", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.042$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.66$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.66) * q, dxi/dt = (xi^2 - 0.042*xi) / 0.66, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.66, 0.042, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0504", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 9.7$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.7}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.4250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.7\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0505", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.44$, $\\sigma_1 = 0.209$, and $\\sigma_2 = 0.17$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04368 S_t^2 V_t + 0.03127 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.04368*S^2*V + 0.03127*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04368 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 160.63, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.44 * dW1 + np.sqrt(1 - 0.44**2) * dZ\ndS = 0.0683 * S0 * dt + 0.209 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.17 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0683*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.04368*S0**2*V0 + 0.03127*S0**2*np.sqrt(V0))*dt + 2*0.209*S0**2*V0*dW1 + 0.17*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0506", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.067$ and volatility $\\sigma = 0.239$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 96.5$ at maturity $T = 1.32$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 96.5, 0)$.", "ground_truth_answer": "dV/dt + 0.067*S*dV/dS + 0.5*0.05712*S^2*d2V/dS2 - 0.067*V = 0, V(S, 1.32) = max(S - 96.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 96.5, 0.067, 0.239, 1.32\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0507", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 1.3$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.85e-06$, temporary impact is $\\eta = 1.40e-05$, and trader risk aversion is $\\lambda = 3.10e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.10e-06 \\times 0.09}{1.40e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(1.3) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.1e-06 * 0.09 / 1.4e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 1.3, 1.4e-05, 3.1e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0508", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 109.36$, paying a known discrete dividend $D = 2.54$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 95.91$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 109.36$, $D e^{-r t_D} = 2.4773$, and $K e^{-r T} = 91.2324$.\nTheoretical difference $C_0 - P_0 = 109.36 - 2.4773 - 91.2324 = 15.6503$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 15.6503)$.", "ground_truth_answer": "C0 - P0 = 15.6503, Lower bound = 15.6503", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 109.36, 95.91, 2.54, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 15.6503, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0509", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.049$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.5$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.5) * q, dxi/dt = (xi^2 - 0.049*xi) / 1.5, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.5, 0.049, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0510", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 3.0$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.0}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.7500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.0\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0511", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.73$, $\\sigma_1 = 0.279$, and $\\sigma_2 = 0.206$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.23352 S_t^3 V_t + -0.12587 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.23352*S^3*V + -0.12587*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.23352 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 142.25, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.73 * dW1 + np.sqrt(1 - -0.73**2) * dZ\ndS = 0.102 * S0 * dt + 0.279 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.206 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.102*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.23352*S0**3*V0 + -0.12587*S0**3*np.sqrt(V0))*dt + 3*0.279*S0**3*V0*dW1 + 0.206*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0512", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.039$ and volatility $\\sigma = 0.181$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 99.0$ at maturity $T = 0.67$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 99.0, 0)$.", "ground_truth_answer": "dV/dt + 0.039*S*dV/dS + 0.5*0.03276*S^2*d2V/dS2 - 0.039*V = 0, V(S, 0.67) = max(S - 99.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 99.0, 0.039, 0.181, 0.67\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0513", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.6$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.95e-06$, temporary impact is $\\eta = 3.77e-05$, and trader risk aversion is $\\lambda = 8.14e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{8.14e-05 \\times 0.09}{3.77e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.6) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(8.14e-05 * 0.09 / 3.77e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.6, 3.77e-05, 8.14e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0514", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 92.56$, paying a known discrete dividend $D = 2.86$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 96.77$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 92.56$, $D e^{-r t_D} = 2.7894$, and $K e^{-r T} = 92.0505$.\nTheoretical difference $C_0 - P_0 = 92.56 - 2.7894 - 92.0505 = -2.2799$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -2.2799, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 92.56, 96.77, 2.86, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -2.2799, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0515", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.014$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.06$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.06) * q, dxi/dt = (xi^2 - 0.014*xi) / 1.06, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.06, 0.014, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0516", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 5.5$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.5}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.3750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.5\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0517", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.48$, $\\sigma_1 = 0.198$, and $\\sigma_2 = 0.124$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.11761 S_t^3 V_t + -0.03535 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.11761*S^3*V + -0.03535*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.11761 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 141.94, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.48 * dW1 + np.sqrt(1 - -0.48**2) * dZ\ndS = 0.1154 * S0 * dt + 0.198 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.124 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.1154*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.11761*S0**3*V0 + -0.03535*S0**3*np.sqrt(V0))*dt + 3*0.198*S0**3*V0*dW1 + 0.124*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0518", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.021$ and volatility $\\sigma = 0.398$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 106.9$ at maturity $T = 0.98$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 106.9, 0)$.", "ground_truth_answer": "dV/dt + 0.021*S*dV/dS + 0.5*0.15840*S^2*d2V/dS2 - 0.021*V = 0, V(S, 0.98) = max(S - 106.9, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 106.9, 0.021, 0.398, 0.98\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0519", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 4.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.25e-06$, temporary impact is $\\eta = 4.60e-05$, and trader risk aversion is $\\lambda = 2.60e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{2.60e-05 \\times 0.09}{4.60e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(4.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(2.6e-05 * 0.09 / 4.6e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 4.0, 4.6e-05, 2.6e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0520", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 99.21$, paying a known discrete dividend $D = 2.46$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 106.84$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 99.21$, $D e^{-r t_D} = 2.3993$, and $K e^{-r T} = 101.6294$.\nTheoretical difference $C_0 - P_0 = 99.21 - 2.3993 - 101.6294 = -4.8187$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -4.8187, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 99.21, 106.84, 2.46, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -4.8187, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0521", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.017$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.58$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.58) * q, dxi/dt = (xi^2 - 0.017*xi) / 0.58, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.58, 0.017, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0522", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 8.0$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.0}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.0000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.0\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0523", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.3$, $\\sigma_1 = 0.296$, and $\\sigma_2 = 0.122$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.26285 S_t^3 V_t + 0.0325 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.26285*S^3*V + 0.0325*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.26285 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 90.4, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.3 * dW1 + np.sqrt(1 - 0.3**2) * dZ\ndS = 0.0832 * S0 * dt + 0.296 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.122 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0832*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.26285*S0**3*V0 + 0.0325*S0**3*np.sqrt(V0))*dt + 3*0.296*S0**3*V0*dW1 + 0.122*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0524", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.069$ and volatility $\\sigma = 0.203$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 100.2$ at maturity $T = 1.76$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 100.2, 0)$.", "ground_truth_answer": "dV/dt + 0.069*S*dV/dS + 0.5*0.04121*S^2*d2V/dS2 - 0.069*V = 0, V(S, 1.76) = max(S - 100.2, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 100.2, 0.069, 0.203, 1.76\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0525", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.13e-06$, temporary impact is $\\eta = 3.82e-05$, and trader risk aversion is $\\lambda = 7.46e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.46e-05 \\times 0.09}{3.82e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.46e-05 * 0.09 / 3.82e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.4, 3.82e-05, 7.46e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0526", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 92.12$, paying a known discrete dividend $D = 1.19$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 93.03$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 92.12$, $D e^{-r t_D} = 1.1606$, and $K e^{-r T} = 88.4929$.\nTheoretical difference $C_0 - P_0 = 92.12 - 1.1606 - 88.4929 = 2.4665$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 2.4665)$.", "ground_truth_answer": "C0 - P0 = 2.4665, Lower bound = 2.4665", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 92.12, 93.03, 1.19, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 2.4665, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0527", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.045$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.15$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.15) * q, dxi/dt = (xi^2 - 0.045*xi) / 1.15, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.15, 0.045, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0528", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 6.5$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.5}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.6250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.5\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0529", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.49$, $\\sigma_1 = 0.326$, and $\\sigma_2 = 0.156$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.31883 S_t^3 V_t + -0.07476 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.31883*S^3*V + -0.07476*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.31883 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 171.76, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.49 * dW1 + np.sqrt(1 - -0.49**2) * dZ\ndS = 0.0993 * S0 * dt + 0.326 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.156 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0993*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.31883*S0**3*V0 + -0.07476*S0**3*np.sqrt(V0))*dt + 3*0.326*S0**3*V0*dW1 + 0.156*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0530", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.068$ and volatility $\\sigma = 0.201$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 102.2$ at maturity $T = 1.6$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 102.2, 0)$.", "ground_truth_answer": "dV/dt + 0.068*S*dV/dS + 0.5*0.04040*S^2*d2V/dS2 - 0.068*V = 0, V(S, 1.6) = max(S - 102.2, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 102.2, 0.068, 0.201, 1.6\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0531", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 3.2$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.11e-06$, temporary impact is $\\eta = 3.47e-05$, and trader risk aversion is $\\lambda = 3.82e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.82e-05 \\times 0.09}{3.47e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(3.2) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.82e-05 * 0.09 / 3.47e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 3.2, 3.47e-05, 3.82e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0532", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 100.48$, paying a known discrete dividend $D = 2.68$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 106.96$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 100.48$, $D e^{-r t_D} = 2.6138$, and $K e^{-r T} = 101.7435$.\nTheoretical difference $C_0 - P_0 = 100.48 - 2.6138 - 101.7435 = -3.8773$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -3.8773, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 100.48, 106.96, 2.68, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -3.8773, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0533", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.01$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.62$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.62) * q, dxi/dt = (xi^2 - 0.01*xi) / 1.62, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.62, 0.01, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0534", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 4.9$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.9}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.2250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.9\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0535", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.79$, $\\sigma_1 = 0.211$, and $\\sigma_2 = 0.275$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.13356 S_t^3 V_t + 0.13752 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.13356*S^3*V + 0.13752*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.13356 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 99.04, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.79 * dW1 + np.sqrt(1 - 0.79**2) * dZ\ndS = 0.0519 * S0 * dt + 0.211 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.275 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0519*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.13356*S0**3*V0 + 0.13752*S0**3*np.sqrt(V0))*dt + 3*0.211*S0**3*V0*dW1 + 0.275*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0536", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.043$ and volatility $\\sigma = 0.311$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 111.2$ at maturity $T = 0.83$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 111.2, 0)$.", "ground_truth_answer": "dV/dt + 0.043*S*dV/dS + 0.5*0.09672*S^2*d2V/dS2 - 0.043*V = 0, V(S, 0.83) = max(S - 111.2, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 111.2, 0.043, 0.311, 0.83\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0537", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 1.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.02e-06$, temporary impact is $\\eta = 2.12e-05$, and trader risk aversion is $\\lambda = 6.99e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.99e-05 \\times 0.09}{2.12e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(1.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.99e-05 * 0.09 / 2.12e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 1.0, 2.12e-05, 6.99e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0538", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 102.39$, paying a known discrete dividend $D = 2.59$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 97.11$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 102.39$, $D e^{-r t_D} = 2.5261$, and $K e^{-r T} = 92.3739$.\nTheoretical difference $C_0 - P_0 = 102.39 - 2.5261 - 92.3739 = 7.4900$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 7.4900)$.", "ground_truth_answer": "C0 - P0 = 7.4900, Lower bound = 7.4900", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 102.39, 97.11, 2.59, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 7.49, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0539", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.034$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.22$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.22) * q, dxi/dt = (xi^2 - 0.034*xi) / 1.22, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.22, 0.034, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0540", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 7.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.9500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0541", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.02$, $\\sigma_1 = 0.291$, and $\\sigma_2 = 0.111$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.25404 S_t^3 V_t + -0.00194 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.25404*S^3*V + -0.00194*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.25404 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 65.62, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.02 * dW1 + np.sqrt(1 - -0.02**2) * dZ\ndS = 0.058 * S0 * dt + 0.291 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.111 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.058*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.25404*S0**3*V0 + -0.00194*S0**3*np.sqrt(V0))*dt + 3*0.291*S0**3*V0*dW1 + 0.111*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0542", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.068$ and volatility $\\sigma = 0.217$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 113.0$ at maturity $T = 1.25$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 113.0, 0)$.", "ground_truth_answer": "dV/dt + 0.068*S*dV/dS + 0.5*0.04709*S^2*d2V/dS2 - 0.068*V = 0, V(S, 1.25) = max(S - 113.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 113.0, 0.068, 0.217, 1.25\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0543", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 4.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 8.30e-07$, temporary impact is $\\eta = 3.51e-05$, and trader risk aversion is $\\lambda = 7.48e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.48e-05 \\times 0.09}{3.51e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(4.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.48e-05 * 0.09 / 3.51e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 4.9, 3.51e-05, 7.48e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0544", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 94.20$, paying a known discrete dividend $D = 2.04$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 106.50$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 94.2$, $D e^{-r t_D} = 1.9896$, and $K e^{-r T} = 101.3059$.\nTheoretical difference $C_0 - P_0 = 94.2 - 1.9896 - 101.3059 = -9.0955$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -9.0955, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 94.2, 106.5, 2.04, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -9.0955, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0545", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.016$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.99$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.99) * q, dxi/dt = (xi^2 - 0.016*xi) / 0.99, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.99, 0.016, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0546", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 3.9$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.9}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.9750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.9\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0547", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.37$, $\\sigma_1 = 0.31$, and $\\sigma_2 = 0.253$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.2883 S_t^3 V_t + 0.08706 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.2883*S^3*V + 0.08706*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.2883 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 105.71, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.37 * dW1 + np.sqrt(1 - 0.37**2) * dZ\ndS = 0.045 * S0 * dt + 0.31 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.253 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.045*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.2883*S0**3*V0 + 0.08706*S0**3*np.sqrt(V0))*dt + 3*0.31*S0**3*V0*dW1 + 0.253*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0548", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.059$ and volatility $\\sigma = 0.255$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 105.4$ at maturity $T = 1.68$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 105.4, 0)$.", "ground_truth_answer": "dV/dt + 0.059*S*dV/dS + 0.5*0.06502*S^2*d2V/dS2 - 0.059*V = 0, V(S, 1.68) = max(S - 105.4, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 105.4, 0.059, 0.255, 1.68\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0549", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 4.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.46e-06$, temporary impact is $\\eta = 4.96e-05$, and trader risk aversion is $\\lambda = 7.50e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.50e-05 \\times 0.09}{4.96e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(4.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.5e-05 * 0.09 / 4.96e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 4.0, 4.96e-05, 7.5e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0550", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 109.01$, paying a known discrete dividend $D = 2.13$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 94.06$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 109.01$, $D e^{-r t_D} = 2.0774$, and $K e^{-r T} = 89.4726$.\nTheoretical difference $C_0 - P_0 = 109.01 - 2.0774 - 89.4726 = 17.4600$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 17.4600)$.", "ground_truth_answer": "C0 - P0 = 17.4600, Lower bound = 17.4600", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 109.01, 94.06, 2.13, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 17.46, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0551", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.023$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.54$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.54) * q, dxi/dt = (xi^2 - 0.023*xi) / 0.54, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.54, 0.023, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0552", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 6.7$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.7}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.6750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.7\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0553", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.71$, $\\sigma_1 = 0.336$, and $\\sigma_2 = 0.257$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.1129 S_t^2 V_t + -0.12262 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.1129*S^2*V + -0.12262*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.1129 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 137.97, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.71 * dW1 + np.sqrt(1 - -0.71**2) * dZ\ndS = 0.0958 * S0 * dt + 0.336 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.257 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0958*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.1129*S0**2*V0 + -0.12262*S0**2*np.sqrt(V0))*dt + 2*0.336*S0**2*V0*dW1 + 0.257*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0554", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.046$ and volatility $\\sigma = 0.368$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 113.7$ at maturity $T = 0.78$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 113.7, 0)$.", "ground_truth_answer": "dV/dt + 0.046*S*dV/dS + 0.5*0.13542*S^2*d2V/dS2 - 0.046*V = 0, V(S, 0.78) = max(S - 113.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 113.7, 0.046, 0.368, 0.78\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0555", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.5$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.23e-06$, temporary impact is $\\eta = 4.69e-05$, and trader risk aversion is $\\lambda = 7.09e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.09e-05 \\times 0.09}{4.69e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.5) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.09e-05 * 0.09 / 4.69e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.5, 4.69e-05, 7.09e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0556", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 91.00$, paying a known discrete dividend $D = 2.82$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 108.08$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 91.0$, $D e^{-r t_D} = 2.7504$, and $K e^{-r T} = 102.8089$.\nTheoretical difference $C_0 - P_0 = 91.0 - 2.7504 - 102.8089 = -14.5593$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -14.5593, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 91.0, 108.08, 2.82, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -14.5593, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0557", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.01$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.59$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.59) * q, dxi/dt = (xi^2 - 0.01*xi) / 0.59, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.59, 0.01, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0558", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 6.9$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.9}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.7250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.9\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0559", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.69$, $\\sigma_1 = 0.281$, and $\\sigma_2 = 0.291$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.23688 S_t^3 V_t + -0.16927 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.23688*S^3*V + -0.16927*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.23688 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 70.3, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.69 * dW1 + np.sqrt(1 - -0.69**2) * dZ\ndS = 0.1001 * S0 * dt + 0.281 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.291 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.1001*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.23688*S0**3*V0 + -0.16927*S0**3*np.sqrt(V0))*dt + 3*0.281*S0**3*V0*dW1 + 0.291*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0560", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.023$ and volatility $\\sigma = 0.159$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 91.0$ at maturity $T = 0.91$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 91.0, 0)$.", "ground_truth_answer": "dV/dt + 0.023*S*dV/dS + 0.5*0.02528*S^2*d2V/dS2 - 0.023*V = 0, V(S, 0.91) = max(S - 91.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 91.0, 0.023, 0.159, 0.91\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0561", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 2.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.32e-06$, temporary impact is $\\eta = 1.43e-05$, and trader risk aversion is $\\lambda = 7.62e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.62e-05 \\times 0.09}{1.43e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(2.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.62e-05 * 0.09 / 1.43e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 2.8, 1.43e-05, 7.62e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0562", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 105.53$, paying a known discrete dividend $D = 1.98$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 91.31$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 105.53$, $D e^{-r t_D} = 1.9311$, and $K e^{-r T} = 86.8568$.\nTheoretical difference $C_0 - P_0 = 105.53 - 1.9311 - 86.8568 = 16.7421$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 16.7421)$.", "ground_truth_answer": "C0 - P0 = 16.7421, Lower bound = 16.7421", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 105.53, 91.31, 1.98, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 16.7421, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0563", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.013$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.86$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.86) * q, dxi/dt = (xi^2 - 0.013*xi) / 1.86, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.86, 0.013, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0564", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 4.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.2000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0565", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.37$, $\\sigma_1 = 0.167$, and $\\sigma_2 = 0.147$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.02789 S_t^2 V_t + 0.01817 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.02789*S^2*V + 0.01817*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.02789 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 97.28, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.37 * dW1 + np.sqrt(1 - 0.37**2) * dZ\ndS = 0.1017 * S0 * dt + 0.167 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.147 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1017*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.02789*S0**2*V0 + 0.01817*S0**2*np.sqrt(V0))*dt + 2*0.167*S0**2*V0*dW1 + 0.147*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0566", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.078$ and volatility $\\sigma = 0.29$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 117.5$ at maturity $T = 0.58$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 117.5, 0)$.", "ground_truth_answer": "dV/dt + 0.078*S*dV/dS + 0.5*0.08410*S^2*d2V/dS2 - 0.078*V = 0, V(S, 0.58) = max(S - 117.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 117.5, 0.078, 0.29, 0.58\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0567", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 3.6$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.68e-06$, temporary impact is $\\eta = 4.91e-05$, and trader risk aversion is $\\lambda = 2.64e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{2.64e-05 \\times 0.09}{4.91e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(3.6) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(2.64e-05 * 0.09 / 4.91e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 3.6, 4.91e-05, 2.64e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0568", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 93.96$, paying a known discrete dividend $D = 1.93$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 101.31$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 93.96$, $D e^{-r t_D} = 1.8823$, and $K e^{-r T} = 96.3691$.\nTheoretical difference $C_0 - P_0 = 93.96 - 1.8823 - 96.3691 = -4.2914$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -4.2914, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 93.96, 101.31, 1.93, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -4.2914, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0569", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.048$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.95$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.95) * q, dxi/dt = (xi^2 - 0.048*xi) / 1.95, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.95, 0.048, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0570", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 2.9$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{2.9}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.7250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 2.9\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0571", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.1$, $\\sigma_1 = 0.2$, and $\\sigma_2 = 0.27$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04 S_t^2 V_t + 0.0108 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.04*S^2*V + 0.0108*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 72.69, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.1 * dW1 + np.sqrt(1 - 0.1**2) * dZ\ndS = 0.058 * S0 * dt + 0.2 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.27 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.058*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.04*S0**2*V0 + 0.0108*S0**2*np.sqrt(V0))*dt + 2*0.2*S0**2*V0*dW1 + 0.27*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0572", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.079$ and volatility $\\sigma = 0.207$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 96.2$ at maturity $T = 1.31$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 96.2, 0)$.", "ground_truth_answer": "dV/dt + 0.079*S*dV/dS + 0.5*0.04285*S^2*d2V/dS2 - 0.079*V = 0, V(S, 1.31) = max(S - 96.2, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 96.2, 0.079, 0.207, 1.31\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0573", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 2.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.57e-06$, temporary impact is $\\eta = 2.76e-05$, and trader risk aversion is $\\lambda = 9.10e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.10e-06 \\times 0.09}{2.76e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(2.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.1e-06 * 0.09 / 2.76e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 2.8, 2.76e-05, 9.1e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0574", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 99.69$, paying a known discrete dividend $D = 2.89$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 93.32$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 99.69$, $D e^{-r t_D} = 2.8186$, and $K e^{-r T} = 88.7687$.\nTheoretical difference $C_0 - P_0 = 99.69 - 2.8186 - 88.7687 = 8.1027$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 8.1027)$.", "ground_truth_answer": "C0 - P0 = 8.1027, Lower bound = 8.1027", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 99.69, 93.32, 2.89, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 8.1027, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0575", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.037$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.19$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.19) * q, dxi/dt = (xi^2 - 0.037*xi) / 1.19, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.19, 0.037, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0576", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 7.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.8000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0577", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.07$, $\\sigma_1 = 0.253$, and $\\sigma_2 = 0.261$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.19203 S_t^3 V_t + -0.01387 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.19203*S^3*V + -0.01387*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.19203 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 131.81, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.07 * dW1 + np.sqrt(1 - -0.07**2) * dZ\ndS = 0.045 * S0 * dt + 0.253 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.261 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.045*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.19203*S0**3*V0 + -0.01387*S0**3*np.sqrt(V0))*dt + 3*0.253*S0**3*V0*dW1 + 0.261*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0578", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.068$ and volatility $\\sigma = 0.274$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 93.6$ at maturity $T = 1.81$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 93.6, 0)$.", "ground_truth_answer": "dV/dt + 0.068*S*dV/dS + 0.5*0.07508*S^2*d2V/dS2 - 0.068*V = 0, V(S, 1.81) = max(S - 93.6, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 93.6, 0.068, 0.274, 1.81\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0579", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 1.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.72e-06$, temporary impact is $\\eta = 3.81e-05$, and trader risk aversion is $\\lambda = 5.24e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.24e-05 \\times 0.09}{3.81e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(1.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.24e-05 * 0.09 / 3.81e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 1.8, 3.81e-05, 5.24e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0580", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 107.56$, paying a known discrete dividend $D = 2.74$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 107.59$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 107.56$, $D e^{-r t_D} = 2.6723$, and $K e^{-r T} = 102.3428$.\nTheoretical difference $C_0 - P_0 = 107.56 - 2.6723 - 102.3428 = 2.5449$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 2.5449)$.", "ground_truth_answer": "C0 - P0 = 2.5449, Lower bound = 2.5449", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 107.56, 107.59, 2.74, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 2.5449, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0581", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.048$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.34$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.34) * q, dxi/dt = (xi^2 - 0.048*xi) / 1.34, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.34, 0.048, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0582", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 6.5$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.5}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.6250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.5\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0583", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.17$, $\\sigma_1 = 0.219$, and $\\sigma_2 = 0.156$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04796 S_t^2 V_t + -0.01162 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.04796*S^2*V + -0.01162*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.04796 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 132.88, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.17 * dW1 + np.sqrt(1 - -0.17**2) * dZ\ndS = 0.0475 * S0 * dt + 0.219 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.156 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0475*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.04796*S0**2*V0 + -0.01162*S0**2*np.sqrt(V0))*dt + 2*0.219*S0**2*V0*dW1 + 0.156*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0584", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.026$ and volatility $\\sigma = 0.314$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 112.9$ at maturity $T = 1.07$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 112.9, 0)$.", "ground_truth_answer": "dV/dt + 0.026*S*dV/dS + 0.5*0.09860*S^2*d2V/dS2 - 0.026*V = 0, V(S, 1.07) = max(S - 112.9, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 112.9, 0.026, 0.314, 1.07\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0585", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 1.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.26e-06$, temporary impact is $\\eta = 1.06e-05$, and trader risk aversion is $\\lambda = 1.95e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.95e-05 \\times 0.09}{1.06e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(1.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1.95e-05 * 0.09 / 1.06e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 1.4, 1.06e-05, 1.95e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0586", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 97.13$, paying a known discrete dividend $D = 1.55$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 105.15$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 97.13$, $D e^{-r t_D} = 1.5117$, and $K e^{-r T} = 100.0218$.\nTheoretical difference $C_0 - P_0 = 97.13 - 1.5117 - 100.0218 = -4.4035$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -4.4035, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 97.13, 105.15, 1.55, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -4.4035, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0587", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.036$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.79$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.79) * q, dxi/dt = (xi^2 - 0.036*xi) / 0.79, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.79, 0.036, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0588", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 6.3$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.3}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.5750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.3\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0589", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.57$, $\\sigma_1 = 0.309$, and $\\sigma_2 = 0.163$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09548 S_t^2 V_t + 0.05742 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.09548*S^2*V + 0.05742*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09548 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 73.69, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.57 * dW1 + np.sqrt(1 - 0.57**2) * dZ\ndS = 0.0957 * S0 * dt + 0.309 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.163 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0957*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.09548*S0**2*V0 + 0.05742*S0**2*np.sqrt(V0))*dt + 2*0.309*S0**2*V0*dW1 + 0.163*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0590", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.074$ and volatility $\\sigma = 0.192$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 100.3$ at maturity $T = 1.4$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 100.3, 0)$.", "ground_truth_answer": "dV/dt + 0.074*S*dV/dS + 0.5*0.03686*S^2*d2V/dS2 - 0.074*V = 0, V(S, 1.4) = max(S - 100.3, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 100.3, 0.074, 0.192, 1.4\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0591", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 1.6$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.00e-06$, temporary impact is $\\eta = 4.48e-05$, and trader risk aversion is $\\lambda = 6.58e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.58e-05 \\times 0.09}{4.48e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(1.6) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.58e-05 * 0.09 / 4.48e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 1.6, 4.48e-05, 6.58e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0592", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 98.81$, paying a known discrete dividend $D = 1.17$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 102.31$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 98.81$, $D e^{-r t_D} = 1.1411$, and $K e^{-r T} = 97.3203$.\nTheoretical difference $C_0 - P_0 = 98.81 - 1.1411 - 97.3203 = 0.3486$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.3486)$.", "ground_truth_answer": "C0 - P0 = 0.3486, Lower bound = 0.3486", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 98.81, 102.31, 1.17, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 0.3486, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0593", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.042$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.26$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.26) * q, dxi/dt = (xi^2 - 0.042*xi) / 1.26, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.26, 0.042, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0594", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 5.3$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.3}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.3250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.3\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0595", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.61$, $\\sigma_1 = 0.277$, and $\\sigma_2 = 0.133$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.07673 S_t^2 V_t + 0.04495 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.07673*S^2*V + 0.04495*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.07673 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 197.62, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.61 * dW1 + np.sqrt(1 - 0.61**2) * dZ\ndS = 0.0934 * S0 * dt + 0.277 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.133 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0934*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.07673*S0**2*V0 + 0.04495*S0**2*np.sqrt(V0))*dt + 2*0.277*S0**2*V0*dW1 + 0.133*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0596", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.059$ and volatility $\\sigma = 0.182$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 107.5$ at maturity $T = 0.64$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 107.5, 0)$.", "ground_truth_answer": "dV/dt + 0.059*S*dV/dS + 0.5*0.03312*S^2*d2V/dS2 - 0.059*V = 0, V(S, 0.64) = max(S - 107.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 107.5, 0.059, 0.182, 0.64\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0597", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 4.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.13e-06$, temporary impact is $\\eta = 1.13e-05$, and trader risk aversion is $\\lambda = 3.85e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.85e-05 \\times 0.09}{1.13e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(4.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.85e-05 * 0.09 / 1.13e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 4.9, 1.13e-05, 3.85e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0598", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 96.74$, paying a known discrete dividend $D = 2.84$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 95.93$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 96.74$, $D e^{-r t_D} = 2.7699$, and $K e^{-r T} = 91.2514$.\nTheoretical difference $C_0 - P_0 = 96.74 - 2.7699 - 91.2514 = 2.7187$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 2.7187)$.", "ground_truth_answer": "C0 - P0 = 2.7187, Lower bound = 2.7187", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 96.74, 95.93, 2.84, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 2.7187, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0599", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.038$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.97$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.97) * q, dxi/dt = (xi^2 - 0.038*xi) / 0.97, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.97, 0.038, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0600", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 9.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.3000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0601", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.61$, $\\sigma_1 = 0.201$, and $\\sigma_2 = 0.264$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.1212 S_t^3 V_t + 0.09711 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.1212*S^3*V + 0.09711*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.1212 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 147.75, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.61 * dW1 + np.sqrt(1 - 0.61**2) * dZ\ndS = 0.0651 * S0 * dt + 0.201 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.264 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0651*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.1212*S0**3*V0 + 0.09711*S0**3*np.sqrt(V0))*dt + 3*0.201*S0**3*V0*dW1 + 0.264*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0602", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.03$ and volatility $\\sigma = 0.328$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 113.0$ at maturity $T = 0.65$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 113.0, 0)$.", "ground_truth_answer": "dV/dt + 0.03*S*dV/dS + 0.5*0.10758*S^2*d2V/dS2 - 0.03*V = 0, V(S, 0.65) = max(S - 113.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 113.0, 0.03, 0.328, 0.65\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0603", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 1.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.16e-06$, temporary impact is $\\eta = 4.54e-05$, and trader risk aversion is $\\lambda = 7.42e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.42e-05 \\times 0.09}{4.54e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(1.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.42e-05 * 0.09 / 4.54e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 1.8, 4.54e-05, 7.42e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0604", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 102.28$, paying a known discrete dividend $D = 2.15$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 98.71$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 102.28$, $D e^{-r t_D} = 2.0969$, and $K e^{-r T} = 93.8959$.\nTheoretical difference $C_0 - P_0 = 102.28 - 2.0969 - 93.8959 = 6.2872$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 6.2872)$.", "ground_truth_answer": "C0 - P0 = 6.2872, Lower bound = 6.2872", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 102.28, 98.71, 2.15, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 6.2872, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0605", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.044$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.21$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.21) * q, dxi/dt = (xi^2 - 0.044*xi) / 1.21, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.21, 0.044, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0606", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 4.0$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.0}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.0000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.0\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0607", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.79$, $\\sigma_1 = 0.171$, and $\\sigma_2 = 0.163$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.02924 S_t^2 V_t + -0.04404 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.02924*S^2*V + -0.04404*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.02924 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 54.67, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.79 * dW1 + np.sqrt(1 - -0.79**2) * dZ\ndS = 0.0991 * S0 * dt + 0.171 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.163 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0991*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.02924*S0**2*V0 + -0.04404*S0**2*np.sqrt(V0))*dt + 2*0.171*S0**2*V0*dW1 + 0.163*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0608", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.03$ and volatility $\\sigma = 0.364$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 89.1$ at maturity $T = 1.76$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 89.1, 0)$.", "ground_truth_answer": "dV/dt + 0.03*S*dV/dS + 0.5*0.13250*S^2*d2V/dS2 - 0.03*V = 0, V(S, 1.76) = max(S - 89.1, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 89.1, 0.03, 0.364, 1.76\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0609", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 1.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.80e-07$, temporary impact is $\\eta = 1.77e-05$, and trader risk aversion is $\\lambda = 8.68e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{8.68e-05 \\times 0.09}{1.77e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(1.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(8.68e-05 * 0.09 / 1.77e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 1.9, 1.77e-05, 8.68e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0610", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 97.21$, paying a known discrete dividend $D = 2.53$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 91.37$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 97.21$, $D e^{-r t_D} = 2.4675$, and $K e^{-r T} = 86.9138$.\nTheoretical difference $C_0 - P_0 = 97.21 - 2.4675 - 86.9138 = 7.8287$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 7.8287)$.", "ground_truth_answer": "C0 - P0 = 7.8287, Lower bound = 7.8287", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 97.21, 91.37, 2.53, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 7.8287, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0611", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.036$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.91$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.91) * q, dxi/dt = (xi^2 - 0.036*xi) / 1.91, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.91, 0.036, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0612", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 8.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.0250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0613", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.27$, $\\sigma_1 = 0.202$, and $\\sigma_2 = 0.281$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0408 S_t^2 V_t + 0.03065 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0408*S^2*V + 0.03065*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0408 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 168.27, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.27 * dW1 + np.sqrt(1 - 0.27**2) * dZ\ndS = 0.0932 * S0 * dt + 0.202 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.281 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0932*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0408*S0**2*V0 + 0.03065*S0**2*np.sqrt(V0))*dt + 2*0.202*S0**2*V0*dW1 + 0.281*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0614", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.03$ and volatility $\\sigma = 0.247$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 95.2$ at maturity $T = 0.84$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 95.2, 0)$.", "ground_truth_answer": "dV/dt + 0.03*S*dV/dS + 0.5*0.06101*S^2*d2V/dS2 - 0.03*V = 0, V(S, 0.84) = max(S - 95.2, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 95.2, 0.03, 0.247, 0.84\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0615", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 1.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.78e-06$, temporary impact is $\\eta = 1.96e-05$, and trader risk aversion is $\\lambda = 9.77e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.77e-05 \\times 0.09}{1.96e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(1.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.77e-05 * 0.09 / 1.96e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 1.4, 1.96e-05, 9.77e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0616", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 98.45$, paying a known discrete dividend $D = 2.48$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 90.84$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 98.45$, $D e^{-r t_D} = 2.4188$, and $K e^{-r T} = 86.4097$.\nTheoretical difference $C_0 - P_0 = 98.45 - 2.4188 - 86.4097 = 9.6215$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 9.6215)$.", "ground_truth_answer": "C0 - P0 = 9.6215, Lower bound = 9.6215", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 98.45, 90.84, 2.48, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 9.6215, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0617", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.049$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.69$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.69) * q, dxi/dt = (xi^2 - 0.049*xi) / 0.69, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.69, 0.049, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0618", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 4.3$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.3}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.0750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.3\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0619", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.74$, $\\sigma_1 = 0.311$, and $\\sigma_2 = 0.104$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09672 S_t^2 V_t + 0.04787 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.09672*S^2*V + 0.04787*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09672 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 186.62, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.74 * dW1 + np.sqrt(1 - 0.74**2) * dZ\ndS = 0.1003 * S0 * dt + 0.311 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.104 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1003*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.09672*S0**2*V0 + 0.04787*S0**2*np.sqrt(V0))*dt + 2*0.311*S0**2*V0*dW1 + 0.104*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0620", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.054$ and volatility $\\sigma = 0.307$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 101.3$ at maturity $T = 1.45$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 101.3, 0)$.", "ground_truth_answer": "dV/dt + 0.054*S*dV/dS + 0.5*0.09425*S^2*d2V/dS2 - 0.054*V = 0, V(S, 1.45) = max(S - 101.3, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 101.3, 0.054, 0.307, 1.45\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0621", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 2.1$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.17e-06$, temporary impact is $\\eta = 6.90e-06$, and trader risk aversion is $\\lambda = 7.80e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.80e-06 \\times 0.09}{6.90e-06}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(2.1) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.8e-06 * 0.09 / 6.9e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 2.1, 6.9e-06, 7.8e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0622", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 90.92$, paying a known discrete dividend $D = 1.57$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 101.34$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 90.92$, $D e^{-r t_D} = 1.5312$, and $K e^{-r T} = 96.3976$.\nTheoretical difference $C_0 - P_0 = 90.92 - 1.5312 - 96.3976 = -7.0088$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -7.0088, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 90.92, 101.34, 1.57, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -7.0088, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0623", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.034$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.95$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.95) * q, dxi/dt = (xi^2 - 0.034*xi) / 0.95, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.95, 0.034, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0624", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 7.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.9500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0625", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.27$, $\\sigma_1 = 0.325$, and $\\sigma_2 = 0.275$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.31688 S_t^3 V_t + -0.07239 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.31688*S^3*V + -0.07239*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.31688 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 139.82, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.27 * dW1 + np.sqrt(1 - -0.27**2) * dZ\ndS = 0.0452 * S0 * dt + 0.325 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.275 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0452*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.31688*S0**3*V0 + -0.07239*S0**3*np.sqrt(V0))*dt + 3*0.325*S0**3*V0*dW1 + 0.275*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0626", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.074$ and volatility $\\sigma = 0.196$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 83.2$ at maturity $T = 0.86$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 83.2, 0)$.", "ground_truth_answer": "dV/dt + 0.074*S*dV/dS + 0.5*0.03842*S^2*d2V/dS2 - 0.074*V = 0, V(S, 0.86) = max(S - 83.2, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 83.2, 0.074, 0.196, 0.86\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0627", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 4.2$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.50e-06$, temporary impact is $\\eta = 2.20e-05$, and trader risk aversion is $\\lambda = 2.75e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{2.75e-05 \\times 0.09}{2.20e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(4.2) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(2.75e-05 * 0.09 / 2.2e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 4.2, 2.2e-05, 2.75e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0628", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 101.47$, paying a known discrete dividend $D = 1.50$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 103.18$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 101.47$, $D e^{-r t_D} = 1.463$, and $K e^{-r T} = 98.1479$.\nTheoretical difference $C_0 - P_0 = 101.47 - 1.463 - 98.1479 = 1.8591$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 1.8591)$.", "ground_truth_answer": "C0 - P0 = 1.8591, Lower bound = 1.8591", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 101.47, 103.18, 1.5, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 1.8591, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0629", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.034$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.67$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.67) * q, dxi/dt = (xi^2 - 0.034*xi) / 0.67, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.67, 0.034, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0630", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 6.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.5500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0631", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.76$, $\\sigma_1 = 0.163$, and $\\sigma_2 = 0.291$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.02657 S_t^2 V_t + -0.0721 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.02657*S^2*V + -0.0721*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.02657 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 54.9, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.76 * dW1 + np.sqrt(1 - -0.76**2) * dZ\ndS = 0.1095 * S0 * dt + 0.163 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.291 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1095*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.02657*S0**2*V0 + -0.0721*S0**2*np.sqrt(V0))*dt + 2*0.163*S0**2*V0*dW1 + 0.291*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0632", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.046$ and volatility $\\sigma = 0.229$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 97.4$ at maturity $T = 1.66$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 97.4, 0)$.", "ground_truth_answer": "dV/dt + 0.046*S*dV/dS + 0.5*0.05244*S^2*d2V/dS2 - 0.046*V = 0, V(S, 1.66) = max(S - 97.4, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 97.4, 0.046, 0.229, 1.66\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0633", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 4.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.77e-06$, temporary impact is $\\eta = 9.10e-06$, and trader risk aversion is $\\lambda = 1.79e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.79e-05 \\times 0.09}{9.10e-06}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(4.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1.79e-05 * 0.09 / 9.1e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 4.8, 9.1e-06, 1.79e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0634", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 98.90$, paying a known discrete dividend $D = 2.28$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 105.78$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 98.9$, $D e^{-r t_D} = 2.2237$, and $K e^{-r T} = 100.621$.\nTheoretical difference $C_0 - P_0 = 98.9 - 2.2237 - 100.621 = -3.9447$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -3.9447, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 98.9, 105.78, 2.28, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -3.9447, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0635", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.03$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.66$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.66) * q, dxi/dt = (xi^2 - 0.03*xi) / 0.66, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.66, 0.03, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0636", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 8.3$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.3}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.0750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.3\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0637", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.77$, $\\sigma_1 = 0.204$, and $\\sigma_2 = 0.195$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.12485 S_t^3 V_t + 0.09189 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.12485*S^3*V + 0.09189*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.12485 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 195.61, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.77 * dW1 + np.sqrt(1 - 0.77**2) * dZ\ndS = 0.061 * S0 * dt + 0.204 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.195 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.061*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.12485*S0**3*V0 + 0.09189*S0**3*np.sqrt(V0))*dt + 3*0.204*S0**3*V0*dW1 + 0.195*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0638", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.058$ and volatility $\\sigma = 0.168$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 90.2$ at maturity $T = 1.04$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 90.2, 0)$.", "ground_truth_answer": "dV/dt + 0.058*S*dV/dS + 0.5*0.02822*S^2*d2V/dS2 - 0.058*V = 0, V(S, 1.04) = max(S - 90.2, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 90.2, 0.058, 0.168, 1.04\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0639", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 4.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.20e-07$, temporary impact is $\\eta = 7.90e-06$, and trader risk aversion is $\\lambda = 2.84e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{2.84e-05 \\times 0.09}{7.90e-06}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(4.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(2.84e-05 * 0.09 / 7.9e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 4.9, 7.9e-06, 2.84e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0640", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 96.63$, paying a known discrete dividend $D = 1.39$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 99.64$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 96.63$, $D e^{-r t_D} = 1.3557$, and $K e^{-r T} = 94.7805$.\nTheoretical difference $C_0 - P_0 = 96.63 - 1.3557 - 94.7805 = 0.4938$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.4938)$.", "ground_truth_answer": "C0 - P0 = 0.4938, Lower bound = 0.4938", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 96.63, 99.64, 1.39, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 0.4938, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0641", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.028$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.21$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.21) * q, dxi/dt = (xi^2 - 0.028*xi) / 1.21, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.21, 0.028, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0642", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 6.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.5250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0643", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.63$, $\\sigma_1 = 0.194$, and $\\sigma_2 = 0.107$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.11291 S_t^3 V_t + -0.03923 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.11291*S^3*V + -0.03923*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.11291 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 50.83, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.63 * dW1 + np.sqrt(1 - -0.63**2) * dZ\ndS = 0.0406 * S0 * dt + 0.194 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.107 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0406*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.11291*S0**3*V0 + -0.03923*S0**3*np.sqrt(V0))*dt + 3*0.194*S0**3*V0*dW1 + 0.107*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0644", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.048$ and volatility $\\sigma = 0.26$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 88.7$ at maturity $T = 1.1$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 88.7, 0)$.", "ground_truth_answer": "dV/dt + 0.048*S*dV/dS + 0.5*0.06760*S^2*d2V/dS2 - 0.048*V = 0, V(S, 1.1) = max(S - 88.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 88.7, 0.048, 0.26, 1.1\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0645", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 3.5$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.67e-06$, temporary impact is $\\eta = 2.05e-05$, and trader risk aversion is $\\lambda = 9.60e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.60e-06 \\times 0.09}{2.05e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(3.5) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.6e-06 * 0.09 / 2.05e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 3.5, 2.05e-05, 9.6e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0646", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 92.28$, paying a known discrete dividend $D = 2.01$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 96.90$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 92.28$, $D e^{-r t_D} = 1.9604$, and $K e^{-r T} = 92.1741$.\nTheoretical difference $C_0 - P_0 = 92.28 - 1.9604 - 92.1741 = -1.8545$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -1.8545, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 92.28, 96.9, 2.01, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -1.8545, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0647", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.011$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.51$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.51) * q, dxi/dt = (xi^2 - 0.011*xi) / 1.51, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.51, 0.011, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0648", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 9.9$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.9}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.4750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.9\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0649", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.14$, $\\sigma_1 = 0.229$, and $\\sigma_2 = 0.184$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.15732 S_t^3 V_t + -0.0177 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.15732*S^3*V + -0.0177*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.15732 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 69.72, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.14 * dW1 + np.sqrt(1 - -0.14**2) * dZ\ndS = 0.062 * S0 * dt + 0.229 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.184 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.062*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.15732*S0**3*V0 + -0.0177*S0**3*np.sqrt(V0))*dt + 3*0.229*S0**3*V0*dW1 + 0.184*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0650", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.06$ and volatility $\\sigma = 0.215$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 107.0$ at maturity $T = 0.95$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 107.0, 0)$.", "ground_truth_answer": "dV/dt + 0.06*S*dV/dS + 0.5*0.04622*S^2*d2V/dS2 - 0.06*V = 0, V(S, 0.95) = max(S - 107.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 107.0, 0.06, 0.215, 0.95\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0651", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 3.5$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.78e-06$, temporary impact is $\\eta = 4.12e-05$, and trader risk aversion is $\\lambda = 1.20e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.20e-06 \\times 0.09}{4.12e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(3.5) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1.2e-06 * 0.09 / 4.12e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 3.5, 4.12e-05, 1.2e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0652", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 91.02$, paying a known discrete dividend $D = 1.12$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 95.15$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 91.02$, $D e^{-r t_D} = 1.0923$, and $K e^{-r T} = 90.5095$.\nTheoretical difference $C_0 - P_0 = 91.02 - 1.0923 - 90.5095 = -0.5818$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -0.5818, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 91.02, 95.15, 1.12, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -0.5818, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0653", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.045$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.89$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.89) * q, dxi/dt = (xi^2 - 0.045*xi) / 0.89, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.89, 0.045, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0654", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 8.4$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.4}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.1000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.4\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0655", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.64$, $\\sigma_1 = 0.269$, and $\\sigma_2 = 0.21$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.21708 S_t^3 V_t + 0.10846 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.21708*S^3*V + 0.10846*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.21708 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 149.4, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.64 * dW1 + np.sqrt(1 - 0.64**2) * dZ\ndS = 0.0474 * S0 * dt + 0.269 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.21 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0474*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.21708*S0**3*V0 + 0.10846*S0**3*np.sqrt(V0))*dt + 3*0.269*S0**3*V0*dW1 + 0.21*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0656", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.025$ and volatility $\\sigma = 0.239$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 117.7$ at maturity $T = 1.5$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 117.7, 0)$.", "ground_truth_answer": "dV/dt + 0.025*S*dV/dS + 0.5*0.05712*S^2*d2V/dS2 - 0.025*V = 0, V(S, 1.5) = max(S - 117.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 117.7, 0.025, 0.239, 1.5\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0657", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.27e-06$, temporary impact is $\\eta = 4.45e-05$, and trader risk aversion is $\\lambda = 6.03e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.03e-05 \\times 0.09}{4.45e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.03e-05 * 0.09 / 4.45e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.0, 4.45e-05, 6.03e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0658", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 92.78$, paying a known discrete dividend $D = 1.31$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 92.31$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 92.78$, $D e^{-r t_D} = 1.2777$, and $K e^{-r T} = 87.808$.\nTheoretical difference $C_0 - P_0 = 92.78 - 1.2777 - 87.808 = 3.6943$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 3.6943)$.", "ground_truth_answer": "C0 - P0 = 3.6943, Lower bound = 3.6943", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 92.78, 92.31, 1.31, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 3.6943, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0659", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.039$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.68$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.68) * q, dxi/dt = (xi^2 - 0.039*xi) / 0.68, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.68, 0.039, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0660", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 6.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.5500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0661", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.05$, $\\sigma_1 = 0.314$, and $\\sigma_2 = 0.239$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0986 S_t^2 V_t + 0.0075 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0986*S^2*V + 0.0075*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0986 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 174.35, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.05 * dW1 + np.sqrt(1 - 0.05**2) * dZ\ndS = 0.1193 * S0 * dt + 0.314 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.239 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1193*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0986*S0**2*V0 + 0.0075*S0**2*np.sqrt(V0))*dt + 2*0.314*S0**2*V0*dW1 + 0.239*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0662", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.049$ and volatility $\\sigma = 0.294$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 81.7$ at maturity $T = 0.68$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 81.7, 0)$.", "ground_truth_answer": "dV/dt + 0.049*S*dV/dS + 0.5*0.08644*S^2*d2V/dS2 - 0.049*V = 0, V(S, 0.68) = max(S - 81.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 81.7, 0.049, 0.294, 0.68\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0663", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 1.3$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.16e-06$, temporary impact is $\\eta = 2.39e-05$, and trader risk aversion is $\\lambda = 8.19e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{8.19e-05 \\times 0.09}{2.39e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(1.3) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(8.19e-05 * 0.09 / 2.39e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 1.3, 2.39e-05, 8.19e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0664", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 97.75$, paying a known discrete dividend $D = 1.81$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 107.04$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 97.75$, $D e^{-r t_D} = 1.7653$, and $K e^{-r T} = 101.8196$.\nTheoretical difference $C_0 - P_0 = 97.75 - 1.7653 - 101.8196 = -5.8349$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -5.8349, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 97.75, 107.04, 1.81, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -5.8349, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0665", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.021$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.96$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.96) * q, dxi/dt = (xi^2 - 0.021*xi) / 0.96, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.96, 0.021, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0666", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 6.7$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.7}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.6750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.7\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0667", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.41$, $\\sigma_1 = 0.24$, and $\\sigma_2 = 0.216$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0576 S_t^2 V_t + 0.04251 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0576*S^2*V + 0.04251*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0576 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 83.94, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.41 * dW1 + np.sqrt(1 - 0.41**2) * dZ\ndS = 0.0707 * S0 * dt + 0.24 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.216 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0707*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0576*S0**2*V0 + 0.04251*S0**2*np.sqrt(V0))*dt + 2*0.24*S0**2*V0*dW1 + 0.216*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0668", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.039$ and volatility $\\sigma = 0.296$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 94.8$ at maturity $T = 1.4$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 94.8, 0)$.", "ground_truth_answer": "dV/dt + 0.039*S*dV/dS + 0.5*0.08762*S^2*d2V/dS2 - 0.039*V = 0, V(S, 1.4) = max(S - 94.8, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 94.8, 0.039, 0.296, 1.4\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0669", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.6$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.68e-06$, temporary impact is $\\eta = 2.61e-05$, and trader risk aversion is $\\lambda = 1.74e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.74e-05 \\times 0.09}{2.61e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.6) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1.74e-05 * 0.09 / 2.61e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.6, 2.61e-05, 1.74e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0670", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 90.90$, paying a known discrete dividend $D = 2.89$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 105.24$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 90.9$, $D e^{-r t_D} = 2.8186$, and $K e^{-r T} = 100.1074$.\nTheoretical difference $C_0 - P_0 = 90.9 - 2.8186 - 100.1074 = -12.0260$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -12.0260, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 90.9, 105.24, 2.89, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -12.026, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0671", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.011$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.47$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.47) * q, dxi/dt = (xi^2 - 0.011*xi) / 1.47, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.47, 0.011, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0672", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 4.7$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.7}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.1750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.7\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0673", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.17$, $\\sigma_1 = 0.212$, and $\\sigma_2 = 0.235$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.13483 S_t^3 V_t + 0.02541 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.13483*S^3*V + 0.02541*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.13483 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 60.76, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.17 * dW1 + np.sqrt(1 - 0.17**2) * dZ\ndS = 0.0728 * S0 * dt + 0.212 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.235 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0728*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.13483*S0**3*V0 + 0.02541*S0**3*np.sqrt(V0))*dt + 3*0.212*S0**3*V0*dW1 + 0.235*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0674", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.071$ and volatility $\\sigma = 0.295$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 102.4$ at maturity $T = 0.66$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 102.4, 0)$.", "ground_truth_answer": "dV/dt + 0.071*S*dV/dS + 0.5*0.08702*S^2*d2V/dS2 - 0.071*V = 0, V(S, 0.66) = max(S - 102.4, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 102.4, 0.071, 0.295, 0.66\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0675", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 7.90e-07$, temporary impact is $\\eta = 2.48e-05$, and trader risk aversion is $\\lambda = 3.70e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.70e-06 \\times 0.09}{2.48e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.7e-06 * 0.09 / 2.48e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.0, 2.48e-05, 3.7e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0676", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 109.28$, paying a known discrete dividend $D = 1.08$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 97.68$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 109.28$, $D e^{-r t_D} = 1.0533$, and $K e^{-r T} = 92.9161$.\nTheoretical difference $C_0 - P_0 = 109.28 - 1.0533 - 92.9161 = 15.3106$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 15.3106)$.", "ground_truth_answer": "C0 - P0 = 15.3106, Lower bound = 15.3106", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 109.28, 97.68, 1.08, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 15.3106, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0677", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.047$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.12$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.12) * q, dxi/dt = (xi^2 - 0.047*xi) / 1.12, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.12, 0.047, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0678", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 2.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{2.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.5500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 2.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0679", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.61$, $\\sigma_1 = 0.208$, and $\\sigma_2 = 0.28$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.12979 S_t^3 V_t + -0.10658 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.12979*S^3*V + -0.10658*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.12979 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 163.43, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.61 * dW1 + np.sqrt(1 - -0.61**2) * dZ\ndS = 0.0767 * S0 * dt + 0.208 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.28 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0767*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.12979*S0**3*V0 + -0.10658*S0**3*np.sqrt(V0))*dt + 3*0.208*S0**3*V0*dW1 + 0.28*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0680", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.042$ and volatility $\\sigma = 0.269$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 97.8$ at maturity $T = 1.99$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 97.8, 0)$.", "ground_truth_answer": "dV/dt + 0.042*S*dV/dS + 0.5*0.07236*S^2*d2V/dS2 - 0.042*V = 0, V(S, 1.99) = max(S - 97.8, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 97.8, 0.042, 0.269, 1.99\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0681", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 2.6$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.92e-06$, temporary impact is $\\eta = 1.51e-05$, and trader risk aversion is $\\lambda = 9.62e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.62e-05 \\times 0.09}{1.51e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(2.6) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.62e-05 * 0.09 / 1.51e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 2.6, 1.51e-05, 9.62e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0682", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 97.71$, paying a known discrete dividend $D = 2.08$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 96.81$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 97.71$, $D e^{-r t_D} = 2.0286$, and $K e^{-r T} = 92.0885$.\nTheoretical difference $C_0 - P_0 = 97.71 - 2.0286 - 92.0885 = 3.5929$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 3.5929)$.", "ground_truth_answer": "C0 - P0 = 3.5929, Lower bound = 3.5929", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 97.71, 96.81, 2.08, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 3.5929, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0683", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.029$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.3$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.3) * q, dxi/dt = (xi^2 - 0.029*xi) / 1.3, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.3, 0.029, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0684", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 8.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.0250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0685", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.49$, $\\sigma_1 = 0.21$, and $\\sigma_2 = 0.152$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0441 S_t^2 V_t + -0.03128 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0441*S^2*V + -0.03128*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0441 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 175.05, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.49 * dW1 + np.sqrt(1 - -0.49**2) * dZ\ndS = 0.0752 * S0 * dt + 0.21 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.152 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0752*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0441*S0**2*V0 + -0.03128*S0**2*np.sqrt(V0))*dt + 2*0.21*S0**2*V0*dW1 + 0.152*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0686", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.05$ and volatility $\\sigma = 0.319$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 89.4$ at maturity $T = 1.75$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 89.4, 0)$.", "ground_truth_answer": "dV/dt + 0.05*S*dV/dS + 0.5*0.10176*S^2*d2V/dS2 - 0.05*V = 0, V(S, 1.75) = max(S - 89.4, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 89.4, 0.05, 0.319, 1.75\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0687", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 1.6$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 9.10e-07$, temporary impact is $\\eta = 2.96e-05$, and trader risk aversion is $\\lambda = 1.00e-04$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.00e-04 \\times 0.09}{2.96e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(1.6) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(0.0001 * 0.09 / 2.96e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 1.6, 2.96e-05, 0.0001, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0688", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 106.34$, paying a known discrete dividend $D = 2.56$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 94.15$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 106.34$, $D e^{-r t_D} = 2.4968$, and $K e^{-r T} = 89.5583$.\nTheoretical difference $C_0 - P_0 = 106.34 - 2.4968 - 89.5583 = 14.2849$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 14.2849)$.", "ground_truth_answer": "C0 - P0 = 14.2849, Lower bound = 14.2849", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 106.34, 94.15, 2.56, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 14.2849, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0689", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.045$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.44$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.44) * q, dxi/dt = (xi^2 - 0.045*xi) / 1.44, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.44, 0.045, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0690", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 8.3$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.3}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.0750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.3\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0691", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.34$, $\\sigma_1 = 0.18$, and $\\sigma_2 = 0.271$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.0972 S_t^3 V_t + 0.04976 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.0972*S^3*V + 0.04976*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.0972 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 119.22, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.34 * dW1 + np.sqrt(1 - 0.34**2) * dZ\ndS = 0.0985 * S0 * dt + 0.18 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.271 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0985*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.0972*S0**3*V0 + 0.04976*S0**3*np.sqrt(V0))*dt + 3*0.18*S0**3*V0*dW1 + 0.271*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0692", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.034$ and volatility $\\sigma = 0.391$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 116.4$ at maturity $T = 1.58$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 116.4, 0)$.", "ground_truth_answer": "dV/dt + 0.034*S*dV/dS + 0.5*0.15288*S^2*d2V/dS2 - 0.034*V = 0, V(S, 1.58) = max(S - 116.4, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 116.4, 0.034, 0.391, 1.58\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0693", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.2$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.35e-06$, temporary impact is $\\eta = 2.90e-06$, and trader risk aversion is $\\lambda = 7.48e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.48e-05 \\times 0.09}{2.90e-06}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.2) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.48e-05 * 0.09 / 2.9e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.2, 2.9e-06, 7.48e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0694", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 91.15$, paying a known discrete dividend $D = 1.93$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 103.62$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 91.15$, $D e^{-r t_D} = 1.8823$, and $K e^{-r T} = 98.5664$.\nTheoretical difference $C_0 - P_0 = 91.15 - 1.8823 - 98.5664 = -9.2987$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -9.2987, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 91.15, 103.62, 1.93, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -9.2987, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0695", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.048$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.72$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.72) * q, dxi/dt = (xi^2 - 0.048*xi) / 0.72, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.72, 0.048, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0696", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 6.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.5250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0697", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.01$, $\\sigma_1 = 0.248$, and $\\sigma_2 = 0.16$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0615 S_t^2 V_t + -0.00079 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0615*S^2*V + -0.00079*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0615 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 64.05, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.01 * dW1 + np.sqrt(1 - -0.01**2) * dZ\ndS = 0.1004 * S0 * dt + 0.248 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.16 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1004*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0615*S0**2*V0 + -0.00079*S0**2*np.sqrt(V0))*dt + 2*0.248*S0**2*V0*dW1 + 0.16*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0698", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.032$ and volatility $\\sigma = 0.34$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 95.5$ at maturity $T = 1.27$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 95.5, 0)$.", "ground_truth_answer": "dV/dt + 0.032*S*dV/dS + 0.5*0.11560*S^2*d2V/dS2 - 0.032*V = 0, V(S, 1.27) = max(S - 95.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 95.5, 0.032, 0.34, 1.27\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0699", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 2.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.88e-06$, temporary impact is $\\eta = 3.66e-05$, and trader risk aversion is $\\lambda = 8.96e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{8.96e-05 \\times 0.09}{3.66e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(2.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(8.96e-05 * 0.09 / 3.66e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 2.8, 3.66e-05, 8.96e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0700", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 98.87$, paying a known discrete dividend $D = 2.18$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 102.04$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 98.87$, $D e^{-r t_D} = 2.1262$, and $K e^{-r T} = 97.0635$.\nTheoretical difference $C_0 - P_0 = 98.87 - 2.1262 - 97.0635 = -0.3197$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -0.3197, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 98.87, 102.04, 2.18, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -0.3197, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0701", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.048$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.8$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.8) * q, dxi/dt = (xi^2 - 0.048*xi) / 0.8, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.8, 0.048, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0702", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 2.5$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{2.5}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.6250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 2.5\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0703", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.3$, $\\sigma_1 = 0.21$, and $\\sigma_2 = 0.148$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0441 S_t^2 V_t + -0.01865 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0441*S^2*V + -0.01865*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0441 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 50.48, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.3 * dW1 + np.sqrt(1 - -0.3**2) * dZ\ndS = 0.0912 * S0 * dt + 0.21 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.148 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0912*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0441*S0**2*V0 + -0.01865*S0**2*np.sqrt(V0))*dt + 2*0.21*S0**2*V0*dW1 + 0.148*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0704", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.047$ and volatility $\\sigma = 0.278$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 105.1$ at maturity $T = 1.89$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 105.1, 0)$.", "ground_truth_answer": "dV/dt + 0.047*S*dV/dS + 0.5*0.07728*S^2*d2V/dS2 - 0.047*V = 0, V(S, 1.89) = max(S - 105.1, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 105.1, 0.047, 0.278, 1.89\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0705", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 3.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.44e-06$, temporary impact is $\\eta = 3.47e-05$, and trader risk aversion is $\\lambda = 7.25e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.25e-05 \\times 0.09}{3.47e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(3.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.25e-05 * 0.09 / 3.47e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 3.8, 3.47e-05, 7.25e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0706", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 92.69$, paying a known discrete dividend $D = 1.72$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 95.99$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 92.69$, $D e^{-r t_D} = 1.6775$, and $K e^{-r T} = 91.3085$.\nTheoretical difference $C_0 - P_0 = 92.69 - 1.6775 - 91.3085 = -0.2960$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -0.2960, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 92.69, 95.99, 1.72, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -0.296, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0707", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.023$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.6$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.6) * q, dxi/dt = (xi^2 - 0.023*xi) / 1.6, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.6, 0.023, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0708", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 9.7$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.7}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.4250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.7\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0709", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.33$, $\\sigma_1 = 0.285$, and $\\sigma_2 = 0.266$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.08122 S_t^2 V_t + -0.05003 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.08122*S^2*V + -0.05003*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.08122 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 51.33, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.33 * dW1 + np.sqrt(1 - -0.33**2) * dZ\ndS = 0.1198 * S0 * dt + 0.285 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.266 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1198*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.08122*S0**2*V0 + -0.05003*S0**2*np.sqrt(V0))*dt + 2*0.285*S0**2*V0*dW1 + 0.266*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0710", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.023$ and volatility $\\sigma = 0.235$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 105.3$ at maturity $T = 0.6$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 105.3, 0)$.", "ground_truth_answer": "dV/dt + 0.023*S*dV/dS + 0.5*0.05522*S^2*d2V/dS2 - 0.023*V = 0, V(S, 0.6) = max(S - 105.3, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 105.3, 0.023, 0.235, 0.6\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0711", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 4.1$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.79e-06$, temporary impact is $\\eta = 3.87e-05$, and trader risk aversion is $\\lambda = 6.62e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.62e-05 \\times 0.09}{3.87e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(4.1) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.62e-05 * 0.09 / 3.87e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 4.1, 3.87e-05, 6.62e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0712", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 106.92$, paying a known discrete dividend $D = 1.18$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 102.27$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 106.92$, $D e^{-r t_D} = 1.1509$, and $K e^{-r T} = 97.2822$.\nTheoretical difference $C_0 - P_0 = 106.92 - 1.1509 - 97.2822 = 8.4869$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 8.4869)$.", "ground_truth_answer": "C0 - P0 = 8.4869, Lower bound = 8.4869", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 106.92, 102.27, 1.18, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 8.4869, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0713", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.039$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.92$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.92) * q, dxi/dt = (xi^2 - 0.039*xi) / 0.92, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.92, 0.039, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0714", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 2.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{2.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.5500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 2.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0715", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.32$, $\\sigma_1 = 0.276$, and $\\sigma_2 = 0.215$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.07618 S_t^2 V_t + 0.03798 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.07618*S^2*V + 0.03798*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.07618 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 95.92, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.32 * dW1 + np.sqrt(1 - 0.32**2) * dZ\ndS = 0.0839 * S0 * dt + 0.276 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.215 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0839*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.07618*S0**2*V0 + 0.03798*S0**2*np.sqrt(V0))*dt + 2*0.276*S0**2*V0*dW1 + 0.215*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0716", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.077$ and volatility $\\sigma = 0.281$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 92.0$ at maturity $T = 0.62$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 92.0, 0)$.", "ground_truth_answer": "dV/dt + 0.077*S*dV/dS + 0.5*0.07896*S^2*d2V/dS2 - 0.077*V = 0, V(S, 0.62) = max(S - 92.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 92.0, 0.077, 0.281, 0.62\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0717", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 1.6$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.23e-06$, temporary impact is $\\eta = 1.29e-05$, and trader risk aversion is $\\lambda = 4.83e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{4.83e-05 \\times 0.09}{1.29e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(1.6) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(4.83e-05 * 0.09 / 1.29e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 1.6, 1.29e-05, 4.83e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0718", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 104.20$, paying a known discrete dividend $D = 1.42$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 103.34$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 104.2$, $D e^{-r t_D} = 1.3849$, and $K e^{-r T} = 98.3$.\nTheoretical difference $C_0 - P_0 = 104.2 - 1.3849 - 98.3 = 4.5151$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 4.5151)$.", "ground_truth_answer": "C0 - P0 = 4.5151, Lower bound = 4.5151", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 104.2, 103.34, 1.42, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 4.5151, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0719", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.021$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.71$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.71) * q, dxi/dt = (xi^2 - 0.021*xi) / 1.71, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.71, 0.021, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0720", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 3.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.8000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0721", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.08$, $\\sigma_1 = 0.267$, and $\\sigma_2 = 0.268$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.21387 S_t^3 V_t + 0.01717 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.21387*S^3*V + 0.01717*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.21387 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 89.93, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.08 * dW1 + np.sqrt(1 - 0.08**2) * dZ\ndS = 0.0418 * S0 * dt + 0.267 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.268 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0418*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.21387*S0**3*V0 + 0.01717*S0**3*np.sqrt(V0))*dt + 3*0.267*S0**3*V0*dW1 + 0.268*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0722", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.079$ and volatility $\\sigma = 0.301$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 94.3$ at maturity $T = 1.47$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 94.3, 0)$.", "ground_truth_answer": "dV/dt + 0.079*S*dV/dS + 0.5*0.09060*S^2*d2V/dS2 - 0.079*V = 0, V(S, 1.47) = max(S - 94.3, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 94.3, 0.079, 0.301, 1.47\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0723", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 2.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.02e-06$, temporary impact is $\\eta = 3.63e-05$, and trader risk aversion is $\\lambda = 8.68e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{8.68e-05 \\times 0.09}{3.63e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(2.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(8.68e-05 * 0.09 / 3.63e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 2.8, 3.63e-05, 8.68e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0724", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 106.43$, paying a known discrete dividend $D = 2.27$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 101.09$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 106.43$, $D e^{-r t_D} = 2.214$, and $K e^{-r T} = 96.1598$.\nTheoretical difference $C_0 - P_0 = 106.43 - 2.214 - 96.1598 = 8.0562$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 8.0562)$.", "ground_truth_answer": "C0 - P0 = 8.0562, Lower bound = 8.0562", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 106.43, 101.09, 2.27, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 8.0562, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0725", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.02$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.57$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.57) * q, dxi/dt = (xi^2 - 0.02*xi) / 1.57, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.57, 0.02, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0726", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 8.4$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.4}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.1000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.4\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0727", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.37$, $\\sigma_1 = 0.179$, and $\\sigma_2 = 0.255$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.03204 S_t^2 V_t + -0.03378 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.03204*S^2*V + -0.03378*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.03204 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 132.88, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.37 * dW1 + np.sqrt(1 - -0.37**2) * dZ\ndS = 0.0816 * S0 * dt + 0.179 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.255 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0816*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.03204*S0**2*V0 + -0.03378*S0**2*np.sqrt(V0))*dt + 2*0.179*S0**2*V0*dW1 + 0.255*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0728", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.03$ and volatility $\\sigma = 0.37$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 113.0$ at maturity $T = 1.58$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 113.0, 0)$.", "ground_truth_answer": "dV/dt + 0.03*S*dV/dS + 0.5*0.13690*S^2*d2V/dS2 - 0.03*V = 0, V(S, 1.58) = max(S - 113.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 113.0, 0.03, 0.37, 1.58\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0729", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.77e-06$, temporary impact is $\\eta = 1.66e-05$, and trader risk aversion is $\\lambda = 1.00e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.00e-06 \\times 0.09}{1.66e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1e-06 * 0.09 / 1.66e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.0, 1.66e-05, 1e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0730", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 90.94$, paying a known discrete dividend $D = 2.41$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 95.52$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 90.94$, $D e^{-r t_D} = 2.3505$, and $K e^{-r T} = 90.8614$.\nTheoretical difference $C_0 - P_0 = 90.94 - 2.3505 - 90.8614 = -2.2719$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -2.2719, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 90.94, 95.52, 2.41, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -2.2719, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0731", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.033$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.2$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.2) * q, dxi/dt = (xi^2 - 0.033*xi) / 1.2, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.2, 0.033, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0732", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 4.0$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.0}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.0000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.0\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0733", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.37$, $\\sigma_1 = 0.17$, and $\\sigma_2 = 0.172$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0289 S_t^2 V_t + -0.02164 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0289*S^2*V + -0.02164*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0289 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 161.14, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.37 * dW1 + np.sqrt(1 - -0.37**2) * dZ\ndS = 0.0653 * S0 * dt + 0.17 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.172 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0653*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0289*S0**2*V0 + -0.02164*S0**2*np.sqrt(V0))*dt + 2*0.17*S0**2*V0*dW1 + 0.172*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0734", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.072$ and volatility $\\sigma = 0.293$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 116.3$ at maturity $T = 1.91$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 116.3, 0)$.", "ground_truth_answer": "dV/dt + 0.072*S*dV/dS + 0.5*0.08585*S^2*d2V/dS2 - 0.072*V = 0, V(S, 1.91) = max(S - 116.3, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 116.3, 0.072, 0.293, 1.91\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0735", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 1.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.56e-06$, temporary impact is $\\eta = 1.95e-05$, and trader risk aversion is $\\lambda = 9.64e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.64e-05 \\times 0.09}{1.95e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(1.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.64e-05 * 0.09 / 1.95e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 1.4, 1.95e-05, 9.64e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0736", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 103.74$, paying a known discrete dividend $D = 1.78$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 99.88$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 103.74$, $D e^{-r t_D} = 1.7361$, and $K e^{-r T} = 95.0088$.\nTheoretical difference $C_0 - P_0 = 103.74 - 1.7361 - 95.0088 = 6.9951$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 6.9951)$.", "ground_truth_answer": "C0 - P0 = 6.9951, Lower bound = 6.9951", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 103.74, 99.88, 1.78, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 6.9951, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0737", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.044$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.51$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.51) * q, dxi/dt = (xi^2 - 0.044*xi) / 1.51, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.51, 0.044, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0738", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 3.3$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.3}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.8250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.3\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0739", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.72$, $\\sigma_1 = 0.343$, and $\\sigma_2 = 0.252$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.11765 S_t^2 V_t + 0.12447 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.11765*S^2*V + 0.12447*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.11765 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 156.96, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.72 * dW1 + np.sqrt(1 - 0.72**2) * dZ\ndS = 0.0933 * S0 * dt + 0.343 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.252 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0933*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.11765*S0**2*V0 + 0.12447*S0**2*np.sqrt(V0))*dt + 2*0.343*S0**2*V0*dW1 + 0.252*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0740", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.077$ and volatility $\\sigma = 0.217$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 99.0$ at maturity $T = 1.45$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 99.0, 0)$.", "ground_truth_answer": "dV/dt + 0.077*S*dV/dS + 0.5*0.04709*S^2*d2V/dS2 - 0.077*V = 0, V(S, 1.45) = max(S - 99.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 99.0, 0.077, 0.217, 1.45\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0741", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.40e-07$, temporary impact is $\\eta = 1.86e-05$, and trader risk aversion is $\\lambda = 9.57e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.57e-05 \\times 0.09}{1.86e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.57e-05 * 0.09 / 1.86e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.0, 1.86e-05, 9.57e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0742", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 98.65$, paying a known discrete dividend $D = 1.42$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 99.15$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 98.65$, $D e^{-r t_D} = 1.3849$, and $K e^{-r T} = 94.3144$.\nTheoretical difference $C_0 - P_0 = 98.65 - 1.3849 - 94.3144 = 2.9507$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 2.9507)$.", "ground_truth_answer": "C0 - P0 = 2.9507, Lower bound = 2.9507", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 98.65, 99.15, 1.42, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 2.9507, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0743", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.041$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.5$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.5) * q, dxi/dt = (xi^2 - 0.041*xi) / 0.5, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.5, 0.041, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0744", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 8.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.0250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0745", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.25$, $\\sigma_1 = 0.32$, and $\\sigma_2 = 0.142$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.1024 S_t^2 V_t + 0.02272 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.1024*S^2*V + 0.02272*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.1024 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 112.48, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.25 * dW1 + np.sqrt(1 - 0.25**2) * dZ\ndS = 0.1058 * S0 * dt + 0.32 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.142 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1058*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.1024*S0**2*V0 + 0.02272*S0**2*np.sqrt(V0))*dt + 2*0.32*S0**2*V0*dW1 + 0.142*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0746", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.064$ and volatility $\\sigma = 0.312$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 111.8$ at maturity $T = 1.63$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 111.8, 0)$.", "ground_truth_answer": "dV/dt + 0.064*S*dV/dS + 0.5*0.09734*S^2*d2V/dS2 - 0.064*V = 0, V(S, 1.63) = max(S - 111.8, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 111.8, 0.064, 0.312, 1.63\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0747", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 4.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.55e-06$, temporary impact is $\\eta = 7.70e-06$, and trader risk aversion is $\\lambda = 6.55e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.55e-05 \\times 0.09}{7.70e-06}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(4.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.55e-05 * 0.09 / 7.7e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 4.0, 7.7e-06, 6.55e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0748", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 96.31$, paying a known discrete dividend $D = 1.79$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 102.90$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 96.31$, $D e^{-r t_D} = 1.7458$, and $K e^{-r T} = 97.8815$.\nTheoretical difference $C_0 - P_0 = 96.31 - 1.7458 - 97.8815 = -3.3173$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -3.3173, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 96.31, 102.9, 1.79, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -3.3173, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0749", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.018$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.84$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.84) * q, dxi/dt = (xi^2 - 0.018*xi) / 1.84, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.84, 0.018, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0750", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 4.9$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.9}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.2250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.9\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0751", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.54$, $\\sigma_1 = 0.253$, and $\\sigma_2 = 0.154$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.19203 S_t^3 V_t + 0.06312 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.19203*S^3*V + 0.06312*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.19203 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 58.71, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.54 * dW1 + np.sqrt(1 - 0.54**2) * dZ\ndS = 0.0489 * S0 * dt + 0.253 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.154 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0489*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.19203*S0**3*V0 + 0.06312*S0**3*np.sqrt(V0))*dt + 3*0.253*S0**3*V0*dW1 + 0.154*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0752", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.035$ and volatility $\\sigma = 0.378$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 113.5$ at maturity $T = 1.56$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 113.5, 0)$.", "ground_truth_answer": "dV/dt + 0.035*S*dV/dS + 0.5*0.14288*S^2*d2V/dS2 - 0.035*V = 0, V(S, 1.56) = max(S - 113.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 113.5, 0.035, 0.378, 1.56\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0753", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 3.1$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.13e-06$, temporary impact is $\\eta = 2.52e-05$, and trader risk aversion is $\\lambda = 4.10e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{4.10e-05 \\times 0.09}{2.52e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(3.1) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(4.1e-05 * 0.09 / 2.52e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 3.1, 2.52e-05, 4.1e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0754", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 101.90$, paying a known discrete dividend $D = 1.93$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 90.20$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 101.9$, $D e^{-r t_D} = 1.8823$, and $K e^{-r T} = 85.8009$.\nTheoretical difference $C_0 - P_0 = 101.9 - 1.8823 - 85.8009 = 14.2168$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 14.2168)$.", "ground_truth_answer": "C0 - P0 = 14.2168, Lower bound = 14.2168", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 101.9, 90.2, 1.93, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 14.2168, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0755", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.031$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.52$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.52) * q, dxi/dt = (xi^2 - 0.031*xi) / 1.52, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.52, 0.031, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0756", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 8.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.0500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0757", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.77$, $\\sigma_1 = 0.345$, and $\\sigma_2 = 0.125$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.11902 S_t^2 V_t + -0.06641 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.11902*S^2*V + -0.06641*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.11902 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 165.94, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.77 * dW1 + np.sqrt(1 - -0.77**2) * dZ\ndS = 0.0817 * S0 * dt + 0.345 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.125 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0817*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.11902*S0**2*V0 + -0.06641*S0**2*np.sqrt(V0))*dt + 2*0.345*S0**2*V0*dW1 + 0.125*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0758", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.043$ and volatility $\\sigma = 0.242$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 87.3$ at maturity $T = 1.15$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 87.3, 0)$.", "ground_truth_answer": "dV/dt + 0.043*S*dV/dS + 0.5*0.05856*S^2*d2V/dS2 - 0.043*V = 0, V(S, 1.15) = max(S - 87.3, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 87.3, 0.043, 0.242, 1.15\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0759", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.6$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.77e-06$, temporary impact is $\\eta = 3.72e-05$, and trader risk aversion is $\\lambda = 2.31e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{2.31e-05 \\times 0.09}{3.72e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.6) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(2.31e-05 * 0.09 / 3.72e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.6, 3.72e-05, 2.31e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0760", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 101.41$, paying a known discrete dividend $D = 2.33$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 101.36$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 101.41$, $D e^{-r t_D} = 2.2725$, and $K e^{-r T} = 96.4166$.\nTheoretical difference $C_0 - P_0 = 101.41 - 2.2725 - 96.4166 = 2.7209$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 2.7209)$.", "ground_truth_answer": "C0 - P0 = 2.7209, Lower bound = 2.7209", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 101.41, 101.36, 2.33, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 2.7209, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0761", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.049$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.77$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.77) * q, dxi/dt = (xi^2 - 0.049*xi) / 1.77, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.77, 0.049, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0762", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 6.4$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.4}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.6000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.4\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0763", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.56$, $\\sigma_1 = 0.208$, and $\\sigma_2 = 0.141$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.12979 S_t^3 V_t + -0.04927 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.12979*S^3*V + -0.04927*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.12979 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 174.46, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.56 * dW1 + np.sqrt(1 - -0.56**2) * dZ\ndS = 0.0885 * S0 * dt + 0.208 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.141 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0885*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.12979*S0**3*V0 + -0.04927*S0**3*np.sqrt(V0))*dt + 3*0.208*S0**3*V0*dW1 + 0.141*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0764", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.024$ and volatility $\\sigma = 0.207$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 89.9$ at maturity $T = 1.23$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 89.9, 0)$.", "ground_truth_answer": "dV/dt + 0.024*S*dV/dS + 0.5*0.04285*S^2*d2V/dS2 - 0.024*V = 0, V(S, 1.23) = max(S - 89.9, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 89.9, 0.024, 0.207, 1.23\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0765", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 5.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.90e-07$, temporary impact is $\\eta = 3.39e-05$, and trader risk aversion is $\\lambda = 5.86e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.86e-05 \\times 0.09}{3.39e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(5.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.86e-05 * 0.09 / 3.39e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 5.0, 3.39e-05, 5.86e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0766", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 94.78$, paying a known discrete dividend $D = 2.30$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 100.61$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 94.78$, $D e^{-r t_D} = 2.2432$, and $K e^{-r T} = 95.7032$.\nTheoretical difference $C_0 - P_0 = 94.78 - 2.2432 - 95.7032 = -3.1664$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -3.1664, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 94.78, 100.61, 2.3, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -3.1664, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0767", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.049$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.61$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.61) * q, dxi/dt = (xi^2 - 0.049*xi) / 0.61, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.61, 0.049, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0768", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 3.6$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.6}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.9000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.6\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0769", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.3$, $\\sigma_1 = 0.329$, and $\\sigma_2 = 0.269$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.10824 S_t^2 V_t + -0.0531 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.10824*S^2*V + -0.0531*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.10824 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 158.84, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.3 * dW1 + np.sqrt(1 - -0.3**2) * dZ\ndS = 0.0896 * S0 * dt + 0.329 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.269 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0896*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.10824*S0**2*V0 + -0.0531*S0**2*np.sqrt(V0))*dt + 2*0.329*S0**2*V0*dW1 + 0.269*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0770", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.029$ and volatility $\\sigma = 0.353$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 105.4$ at maturity $T = 1.08$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 105.4, 0)$.", "ground_truth_answer": "dV/dt + 0.029*S*dV/dS + 0.5*0.12461*S^2*d2V/dS2 - 0.029*V = 0, V(S, 1.08) = max(S - 105.4, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 105.4, 0.029, 0.353, 1.08\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0771", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 2.2$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.37e-06$, temporary impact is $\\eta = 1.79e-05$, and trader risk aversion is $\\lambda = 9.18e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.18e-05 \\times 0.09}{1.79e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(2.2) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.18e-05 * 0.09 / 1.79e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 2.2, 1.79e-05, 9.18e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0772", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 99.40$, paying a known discrete dividend $D = 2.42$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 107.80$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 99.4$, $D e^{-r t_D} = 2.3602$, and $K e^{-r T} = 102.5425$.\nTheoretical difference $C_0 - P_0 = 99.4 - 2.3602 - 102.5425 = -5.5027$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -5.5027, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 99.4, 107.8, 2.42, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -5.5027, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0773", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.038$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.9$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.9) * q, dxi/dt = (xi^2 - 0.038*xi) / 1.9, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.9, 0.038, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0774", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 5.6$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.6}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.4000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.6\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0775", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.0$, $\\sigma_1 = 0.256$, and $\\sigma_2 = 0.148$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.06554 S_t^2 V_t + 0.0 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.06554*S^2*V + 0.0*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.06554 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 70.14, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.0 * dW1 + np.sqrt(1 - 0.0**2) * dZ\ndS = 0.1166 * S0 * dt + 0.256 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.148 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1166*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.06554*S0**2*V0 + 0.0*S0**2*np.sqrt(V0))*dt + 2*0.256*S0**2*V0*dW1 + 0.148*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0776", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.078$ and volatility $\\sigma = 0.305$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 117.1$ at maturity $T = 1.64$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 117.1, 0)$.", "ground_truth_answer": "dV/dt + 0.078*S*dV/dS + 0.5*0.09302*S^2*d2V/dS2 - 0.078*V = 0, V(S, 1.64) = max(S - 117.1, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 117.1, 0.078, 0.305, 1.64\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0777", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 1.7$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.78e-06$, temporary impact is $\\eta = 2.22e-05$, and trader risk aversion is $\\lambda = 5.30e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.30e-06 \\times 0.09}{2.22e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(1.7) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.3e-06 * 0.09 / 2.22e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 1.7, 2.22e-05, 5.3e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0778", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 98.91$, paying a known discrete dividend $D = 1.10$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 94.18$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 98.91$, $D e^{-r t_D} = 1.0728$, and $K e^{-r T} = 89.5868$.\nTheoretical difference $C_0 - P_0 = 98.91 - 1.0728 - 89.5868 = 8.2504$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 8.2504)$.", "ground_truth_answer": "C0 - P0 = 8.2504, Lower bound = 8.2504", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 98.91, 94.18, 1.1, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 8.2504, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0779", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.015$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.99$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.99) * q, dxi/dt = (xi^2 - 0.015*xi) / 1.99, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.99, 0.015, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0780", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 8.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.2000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0781", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.79$, $\\sigma_1 = 0.189$, and $\\sigma_2 = 0.29$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.10716 S_t^3 V_t + 0.1299 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.10716*S^3*V + 0.1299*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.10716 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 86.3, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.79 * dW1 + np.sqrt(1 - 0.79**2) * dZ\ndS = 0.1169 * S0 * dt + 0.189 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.29 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.1169*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.10716*S0**3*V0 + 0.1299*S0**3*np.sqrt(V0))*dt + 3*0.189*S0**3*V0*dW1 + 0.29*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0782", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.077$ and volatility $\\sigma = 0.281$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 88.8$ at maturity $T = 1.19$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 88.8, 0)$.", "ground_truth_answer": "dV/dt + 0.077*S*dV/dS + 0.5*0.07896*S^2*d2V/dS2 - 0.077*V = 0, V(S, 1.19) = max(S - 88.8, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 88.8, 0.077, 0.281, 1.19\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0783", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 4.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.01e-06$, temporary impact is $\\eta = 4.60e-06$, and trader risk aversion is $\\lambda = 6.26e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.26e-05 \\times 0.09}{4.60e-06}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(4.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.26e-05 * 0.09 / 4.6e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 4.9, 4.6e-06, 6.26e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0784", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 93.80$, paying a known discrete dividend $D = 2.82$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 105.85$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 93.8$, $D e^{-r t_D} = 2.7504$, and $K e^{-r T} = 100.6876$.\nTheoretical difference $C_0 - P_0 = 93.8 - 2.7504 - 100.6876 = -9.6380$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -9.6380, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 93.8, 105.85, 2.82, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -9.638, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0785", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.038$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.09$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.09) * q, dxi/dt = (xi^2 - 0.038*xi) / 1.09, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.09, 0.038, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0786", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 9.7$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.7}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.4250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.7\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0787", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.43$, $\\sigma_1 = 0.305$, and $\\sigma_2 = 0.162$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09302 S_t^2 V_t + -0.04249 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.09302*S^2*V + -0.04249*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09302 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 108.92, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.43 * dW1 + np.sqrt(1 - -0.43**2) * dZ\ndS = 0.1083 * S0 * dt + 0.305 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.162 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1083*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.09302*S0**2*V0 + -0.04249*S0**2*np.sqrt(V0))*dt + 2*0.305*S0**2*V0*dW1 + 0.162*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0788", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.06$ and volatility $\\sigma = 0.191$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 102.6$ at maturity $T = 1.66$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 102.6, 0)$.", "ground_truth_answer": "dV/dt + 0.06*S*dV/dS + 0.5*0.03648*S^2*d2V/dS2 - 0.06*V = 0, V(S, 1.66) = max(S - 102.6, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 102.6, 0.06, 0.191, 1.66\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0789", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 2.5$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.06e-06$, temporary impact is $\\eta = 4.19e-05$, and trader risk aversion is $\\lambda = 7.87e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.87e-05 \\times 0.09}{4.19e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(2.5) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.87e-05 * 0.09 / 4.19e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 2.5, 4.19e-05, 7.87e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0790", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 101.04$, paying a known discrete dividend $D = 1.09$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 106.10$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 101.04$, $D e^{-r t_D} = 1.0631$, and $K e^{-r T} = 100.9254$.\nTheoretical difference $C_0 - P_0 = 101.04 - 1.0631 - 100.9254 = -0.9485$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -0.9485, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 101.04, 106.1, 1.09, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -0.9485, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0791", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.023$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.77$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.77) * q, dxi/dt = (xi^2 - 0.023*xi) / 1.77, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.77, 0.023, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0792", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 4.0$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.0}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.0000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.0\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0793", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.64$, $\\sigma_1 = 0.329$, and $\\sigma_2 = 0.1$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.32472 S_t^3 V_t + 0.06317 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.32472*S^3*V + 0.06317*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.32472 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 86.87, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.64 * dW1 + np.sqrt(1 - 0.64**2) * dZ\ndS = 0.0722 * S0 * dt + 0.329 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.1 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0722*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.32472*S0**3*V0 + 0.06317*S0**3*np.sqrt(V0))*dt + 3*0.329*S0**3*V0*dW1 + 0.1*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0794", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.044$ and volatility $\\sigma = 0.38$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 119.7$ at maturity $T = 0.57$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 119.7, 0)$.", "ground_truth_answer": "dV/dt + 0.044*S*dV/dS + 0.5*0.14440*S^2*d2V/dS2 - 0.044*V = 0, V(S, 0.57) = max(S - 119.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 119.7, 0.044, 0.38, 0.57\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0795", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 1.1$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.46e-06$, temporary impact is $\\eta = 3.21e-05$, and trader risk aversion is $\\lambda = 1.00e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.00e-05 \\times 0.09}{3.21e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(1.1) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1e-05 * 0.09 / 3.21e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 1.1, 3.21e-05, 1e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0796", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 91.15$, paying a known discrete dividend $D = 1.55$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 98.89$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 91.15$, $D e^{-r t_D} = 1.5117$, and $K e^{-r T} = 94.0671$.\nTheoretical difference $C_0 - P_0 = 91.15 - 1.5117 - 94.0671 = -4.4288$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -4.4288, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 91.15, 98.89, 1.55, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -4.4288, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0797", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.042$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.88$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.88) * q, dxi/dt = (xi^2 - 0.042*xi) / 0.88, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.88, 0.042, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0798", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 4.9$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.9}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.2250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.9\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0799", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.64$, $\\sigma_1 = 0.188$, and $\\sigma_2 = 0.284$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.10603 S_t^3 V_t + -0.10251 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.10603*S^3*V + -0.10251*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.10603 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 148.49, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.64 * dW1 + np.sqrt(1 - -0.64**2) * dZ\ndS = 0.0592 * S0 * dt + 0.188 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.284 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0592*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.10603*S0**3*V0 + -0.10251*S0**3*np.sqrt(V0))*dt + 3*0.188*S0**3*V0*dW1 + 0.284*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0800", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.07$ and volatility $\\sigma = 0.338$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 89.1$ at maturity $T = 1.93$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 89.1, 0)$.", "ground_truth_answer": "dV/dt + 0.07*S*dV/dS + 0.5*0.11424*S^2*d2V/dS2 - 0.07*V = 0, V(S, 1.93) = max(S - 89.1, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 89.1, 0.07, 0.338, 1.93\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0801", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 3.3$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.35e-06$, temporary impact is $\\eta = 1.48e-05$, and trader risk aversion is $\\lambda = 9.51e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.51e-05 \\times 0.09}{1.48e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(3.3) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.51e-05 * 0.09 / 1.48e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 3.3, 1.48e-05, 9.51e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0802", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 98.73$, paying a known discrete dividend $D = 2.03$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 101.60$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 98.73$, $D e^{-r t_D} = 1.9799$, and $K e^{-r T} = 96.6449$.\nTheoretical difference $C_0 - P_0 = 98.73 - 1.9799 - 96.6449 = 0.1052$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.1052)$.", "ground_truth_answer": "C0 - P0 = 0.1052, Lower bound = 0.1052", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 98.73, 101.6, 2.03, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 0.1052, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0803", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.044$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.72$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.72) * q, dxi/dt = (xi^2 - 0.044*xi) / 0.72, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.72, 0.044, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0804", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 9.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.3000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0805", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.04$, $\\sigma_1 = 0.234$, and $\\sigma_2 = 0.256$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.05476 S_t^2 V_t + -0.00479 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.05476*S^2*V + -0.00479*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.05476 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 191.97, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.04 * dW1 + np.sqrt(1 - -0.04**2) * dZ\ndS = 0.1114 * S0 * dt + 0.234 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.256 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1114*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.05476*S0**2*V0 + -0.00479*S0**2*np.sqrt(V0))*dt + 2*0.234*S0**2*V0*dW1 + 0.256*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0806", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.053$ and volatility $\\sigma = 0.201$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 90.2$ at maturity $T = 0.94$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 90.2, 0)$.", "ground_truth_answer": "dV/dt + 0.053*S*dV/dS + 0.5*0.04040*S^2*d2V/dS2 - 0.053*V = 0, V(S, 0.94) = max(S - 90.2, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 90.2, 0.053, 0.201, 0.94\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0807", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 2.2$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.60e-07$, temporary impact is $\\eta = 3.22e-05$, and trader risk aversion is $\\lambda = 3.71e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.71e-05 \\times 0.09}{3.22e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(2.2) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.71e-05 * 0.09 / 3.22e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 2.2, 3.22e-05, 3.71e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0808", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 107.59$, paying a known discrete dividend $D = 1.19$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 99.20$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 107.59$, $D e^{-r t_D} = 1.1606$, and $K e^{-r T} = 94.362$.\nTheoretical difference $C_0 - P_0 = 107.59 - 1.1606 - 94.362 = 12.0674$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 12.0674)$.", "ground_truth_answer": "C0 - P0 = 12.0674, Lower bound = 12.0674", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 107.59, 99.2, 1.19, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 12.0674, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0809", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.043$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.0$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.0) * q, dxi/dt = (xi^2 - 0.043*xi) / 1.0, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.0, 0.043, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0810", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 8.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.0500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0811", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.73$, $\\sigma_1 = 0.253$, and $\\sigma_2 = 0.193$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.19203 S_t^3 V_t + -0.10694 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.19203*S^3*V + -0.10694*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.19203 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 102.89, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.73 * dW1 + np.sqrt(1 - -0.73**2) * dZ\ndS = 0.106 * S0 * dt + 0.253 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.193 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.106*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.19203*S0**3*V0 + -0.10694*S0**3*np.sqrt(V0))*dt + 3*0.253*S0**3*V0*dW1 + 0.193*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0812", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.046$ and volatility $\\sigma = 0.159$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 85.1$ at maturity $T = 1.65$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 85.1, 0)$.", "ground_truth_answer": "dV/dt + 0.046*S*dV/dS + 0.5*0.02528*S^2*d2V/dS2 - 0.046*V = 0, V(S, 1.65) = max(S - 85.1, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 85.1, 0.046, 0.159, 1.65\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0813", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.99e-06$, temporary impact is $\\eta = 4.00e-06$, and trader risk aversion is $\\lambda = 3.69e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.69e-05 \\times 0.09}{4.00e-06}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.69e-05 * 0.09 / 4e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.9, 4e-06, 3.69e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0814", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 94.01$, paying a known discrete dividend $D = 1.02$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 94.07$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 94.01$, $D e^{-r t_D} = 0.9948$, and $K e^{-r T} = 89.4822$.\nTheoretical difference $C_0 - P_0 = 94.01 - 0.9948 - 89.4822 = 3.5330$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 3.5330)$.", "ground_truth_answer": "C0 - P0 = 3.5330, Lower bound = 3.5330", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 94.01, 94.07, 1.02, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 3.533, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0815", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.045$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.58$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.58) * q, dxi/dt = (xi^2 - 0.045*xi) / 0.58, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.58, 0.045, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0816", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 7.9$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.9}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.9750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.9\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0817", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.63$, $\\sigma_1 = 0.302$, and $\\sigma_2 = 0.222$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0912 S_t^2 V_t + 0.08448 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0912*S^2*V + 0.08448*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0912 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 146.1, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.63 * dW1 + np.sqrt(1 - 0.63**2) * dZ\ndS = 0.0733 * S0 * dt + 0.302 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.222 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0733*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0912*S0**2*V0 + 0.08448*S0**2*np.sqrt(V0))*dt + 2*0.302*S0**2*V0*dW1 + 0.222*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0818", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.063$ and volatility $\\sigma = 0.354$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 87.3$ at maturity $T = 1.06$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 87.3, 0)$.", "ground_truth_answer": "dV/dt + 0.063*S*dV/dS + 0.5*0.12532*S^2*d2V/dS2 - 0.063*V = 0, V(S, 1.06) = max(S - 87.3, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 87.3, 0.063, 0.354, 1.06\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0819", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 4.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 5.00e-06$, temporary impact is $\\eta = 2.09e-05$, and trader risk aversion is $\\lambda = 2.28e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{2.28e-05 \\times 0.09}{2.09e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(4.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(2.28e-05 * 0.09 / 2.09e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 4.0, 2.09e-05, 2.28e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0820", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 100.85$, paying a known discrete dividend $D = 1.76$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 92.99$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 100.85$, $D e^{-r t_D} = 1.7165$, and $K e^{-r T} = 88.4548$.\nTheoretical difference $C_0 - P_0 = 100.85 - 1.7165 - 88.4548 = 10.6787$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 10.6787)$.", "ground_truth_answer": "C0 - P0 = 10.6787, Lower bound = 10.6787", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 100.85, 92.99, 1.76, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 10.6787, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0821", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.032$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.56$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.56) * q, dxi/dt = (xi^2 - 0.032*xi) / 1.56, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.56, 0.032, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0822", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 4.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.0500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0823", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.22$, $\\sigma_1 = 0.276$, and $\\sigma_2 = 0.196$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.22853 S_t^3 V_t + -0.0357 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.22853*S^3*V + -0.0357*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.22853 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 127.64, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.22 * dW1 + np.sqrt(1 - -0.22**2) * dZ\ndS = 0.0615 * S0 * dt + 0.276 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.196 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0615*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.22853*S0**3*V0 + -0.0357*S0**3*np.sqrt(V0))*dt + 3*0.276*S0**3*V0*dW1 + 0.196*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0824", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.038$ and volatility $\\sigma = 0.329$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 110.4$ at maturity $T = 0.65$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 110.4, 0)$.", "ground_truth_answer": "dV/dt + 0.038*S*dV/dS + 0.5*0.10824*S^2*d2V/dS2 - 0.038*V = 0, V(S, 0.65) = max(S - 110.4, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 110.4, 0.038, 0.329, 0.65\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0825", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 2.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.57e-06$, temporary impact is $\\eta = 9.40e-06$, and trader risk aversion is $\\lambda = 9.73e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.73e-05 \\times 0.09}{9.40e-06}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(2.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.73e-05 * 0.09 / 9.4e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 2.8, 9.4e-06, 9.73e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0826", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 93.18$, paying a known discrete dividend $D = 1.20$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 93.60$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 93.18$, $D e^{-r t_D} = 1.1704$, and $K e^{-r T} = 89.0351$.\nTheoretical difference $C_0 - P_0 = 93.18 - 1.1704 - 89.0351 = 2.9745$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 2.9745)$.", "ground_truth_answer": "C0 - P0 = 2.9745, Lower bound = 2.9745", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 93.18, 93.6, 1.2, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 2.9745, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0827", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.047$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.54$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.54) * q, dxi/dt = (xi^2 - 0.047*xi) / 1.54, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.54, 0.047, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0828", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 8.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.2000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0829", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.46$, $\\sigma_1 = 0.16$, and $\\sigma_2 = 0.128$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.0768 S_t^3 V_t + -0.02826 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.0768*S^3*V + -0.02826*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.0768 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 101.69, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.46 * dW1 + np.sqrt(1 - -0.46**2) * dZ\ndS = 0.0425 * S0 * dt + 0.16 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.128 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0425*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.0768*S0**3*V0 + -0.02826*S0**3*np.sqrt(V0))*dt + 3*0.16*S0**3*V0*dW1 + 0.128*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0830", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.079$ and volatility $\\sigma = 0.364$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 108.0$ at maturity $T = 1.59$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 108.0, 0)$.", "ground_truth_answer": "dV/dt + 0.079*S*dV/dS + 0.5*0.13250*S^2*d2V/dS2 - 0.079*V = 0, V(S, 1.59) = max(S - 108.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 108.0, 0.079, 0.364, 1.59\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0831", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 2.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.23e-06$, temporary impact is $\\eta = 2.79e-05$, and trader risk aversion is $\\lambda = 3.19e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.19e-05 \\times 0.09}{2.79e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(2.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.19e-05 * 0.09 / 2.79e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 2.9, 2.79e-05, 3.19e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0832", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 100.13$, paying a known discrete dividend $D = 2.81$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 97.74$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 100.13$, $D e^{-r t_D} = 2.7406$, and $K e^{-r T} = 92.9732$.\nTheoretical difference $C_0 - P_0 = 100.13 - 2.7406 - 92.9732 = 4.4162$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 4.4162)$.", "ground_truth_answer": "C0 - P0 = 4.4162, Lower bound = 4.4162", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 100.13, 97.74, 2.81, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 4.4162, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0833", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.011$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.76$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.76) * q, dxi/dt = (xi^2 - 0.011*xi) / 1.76, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.76, 0.011, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0834", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 7.6$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.6}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.9000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.6\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0835", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.51$, $\\sigma_1 = 0.197$, and $\\sigma_2 = 0.241$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.03881 S_t^2 V_t + 0.04843 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.03881*S^2*V + 0.04843*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.03881 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 195.54, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.51 * dW1 + np.sqrt(1 - 0.51**2) * dZ\ndS = 0.075 * S0 * dt + 0.197 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.241 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.075*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.03881*S0**2*V0 + 0.04843*S0**2*np.sqrt(V0))*dt + 2*0.197*S0**2*V0*dW1 + 0.241*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0836", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.052$ and volatility $\\sigma = 0.285$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 97.2$ at maturity $T = 0.96$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 97.2, 0)$.", "ground_truth_answer": "dV/dt + 0.052*S*dV/dS + 0.5*0.08122*S^2*d2V/dS2 - 0.052*V = 0, V(S, 0.96) = max(S - 97.2, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 97.2, 0.052, 0.285, 0.96\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0837", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 4.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 6.80e-07$, temporary impact is $\\eta = 4.81e-05$, and trader risk aversion is $\\lambda = 7.17e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.17e-05 \\times 0.09}{4.81e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(4.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.17e-05 * 0.09 / 4.81e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 4.8, 4.81e-05, 7.17e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0838", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 94.53$, paying a known discrete dividend $D = 2.62$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 107.59$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 94.53$, $D e^{-r t_D} = 2.5553$, and $K e^{-r T} = 102.3428$.\nTheoretical difference $C_0 - P_0 = 94.53 - 2.5553 - 102.3428 = -10.3681$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -10.3681, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 94.53, 107.59, 2.62, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -10.3681, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0839", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.022$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.94$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.94) * q, dxi/dt = (xi^2 - 0.022*xi) / 0.94, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.94, 0.022, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0840", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 7.4$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.4}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.8500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.4\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0841", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.53$, $\\sigma_1 = 0.275$, and $\\sigma_2 = 0.214$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.07563 S_t^2 V_t + 0.06238 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.07563*S^2*V + 0.06238*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.07563 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 169.5, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.53 * dW1 + np.sqrt(1 - 0.53**2) * dZ\ndS = 0.06 * S0 * dt + 0.275 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.214 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.06*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.07563*S0**2*V0 + 0.06238*S0**2*np.sqrt(V0))*dt + 2*0.275*S0**2*V0*dW1 + 0.214*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0842", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.058$ and volatility $\\sigma = 0.212$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 86.5$ at maturity $T = 0.78$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 86.5, 0)$.", "ground_truth_answer": "dV/dt + 0.058*S*dV/dS + 0.5*0.04494*S^2*d2V/dS2 - 0.058*V = 0, V(S, 0.78) = max(S - 86.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 86.5, 0.058, 0.212, 0.78\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0843", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 4.7$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.01e-06$, temporary impact is $\\eta = 1.04e-05$, and trader risk aversion is $\\lambda = 4.18e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{4.18e-05 \\times 0.09}{1.04e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(4.7) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(4.18e-05 * 0.09 / 1.04e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 4.7, 1.04e-05, 4.18e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0844", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 98.61$, paying a known discrete dividend $D = 2.21$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 107.56$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 98.61$, $D e^{-r t_D} = 2.1554$, and $K e^{-r T} = 102.3142$.\nTheoretical difference $C_0 - P_0 = 98.61 - 2.1554 - 102.3142 = -5.8596$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -5.8596, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 98.61, 107.56, 2.21, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -5.8596, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0845", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.024$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.63$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.63) * q, dxi/dt = (xi^2 - 0.024*xi) / 0.63, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.63, 0.024, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0846", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 7.5$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.5}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.8750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.5\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0847", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.23$, $\\sigma_1 = 0.225$, and $\\sigma_2 = 0.289$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.15188 S_t^3 V_t + 0.04487 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.15188*S^3*V + 0.04487*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.15188 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 99.87, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.23 * dW1 + np.sqrt(1 - 0.23**2) * dZ\ndS = 0.0445 * S0 * dt + 0.225 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.289 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0445*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.15188*S0**3*V0 + 0.04487*S0**3*np.sqrt(V0))*dt + 3*0.225*S0**3*V0*dW1 + 0.289*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0848", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.064$ and volatility $\\sigma = 0.179$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 111.2$ at maturity $T = 1.68$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 111.2, 0)$.", "ground_truth_answer": "dV/dt + 0.064*S*dV/dS + 0.5*0.03204*S^2*d2V/dS2 - 0.064*V = 0, V(S, 1.68) = max(S - 111.2, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 111.2, 0.064, 0.179, 1.68\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0849", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 2.7$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 6.00e-07$, temporary impact is $\\eta = 1.46e-05$, and trader risk aversion is $\\lambda = 2.84e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{2.84e-05 \\times 0.09}{1.46e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(2.7) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(2.84e-05 * 0.09 / 1.46e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 2.7, 1.46e-05, 2.84e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0850", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 109.61$, paying a known discrete dividend $D = 2.04$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 91.35$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 109.61$, $D e^{-r t_D} = 1.9896$, and $K e^{-r T} = 86.8948$.\nTheoretical difference $C_0 - P_0 = 109.61 - 1.9896 - 86.8948 = 20.7256$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 20.7256)$.", "ground_truth_answer": "C0 - P0 = 20.7256, Lower bound = 20.7256", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 109.61, 91.35, 2.04, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 20.7256, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0851", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.014$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.32$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.32) * q, dxi/dt = (xi^2 - 0.014*xi) / 1.32, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.32, 0.014, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0852", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 6.4$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.4}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.6000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.4\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0853", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.68$, $\\sigma_1 = 0.191$, and $\\sigma_2 = 0.204$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.03648 S_t^2 V_t + -0.05299 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.03648*S^2*V + -0.05299*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.03648 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 78.47, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.68 * dW1 + np.sqrt(1 - -0.68**2) * dZ\ndS = 0.0866 * S0 * dt + 0.191 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.204 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0866*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.03648*S0**2*V0 + -0.05299*S0**2*np.sqrt(V0))*dt + 2*0.191*S0**2*V0*dW1 + 0.204*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0854", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.032$ and volatility $\\sigma = 0.271$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 90.7$ at maturity $T = 0.93$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 90.7, 0)$.", "ground_truth_answer": "dV/dt + 0.032*S*dV/dS + 0.5*0.07344*S^2*d2V/dS2 - 0.032*V = 0, V(S, 0.93) = max(S - 90.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 90.7, 0.032, 0.271, 0.93\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0855", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 1.7$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.48e-06$, temporary impact is $\\eta = 8.10e-06$, and trader risk aversion is $\\lambda = 5.99e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.99e-05 \\times 0.09}{8.10e-06}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(1.7) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.99e-05 * 0.09 / 8.1e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 1.7, 8.1e-06, 5.99e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0856", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 108.51$, paying a known discrete dividend $D = 1.86$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 91.37$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 108.51$, $D e^{-r t_D} = 1.8141$, and $K e^{-r T} = 86.9138$.\nTheoretical difference $C_0 - P_0 = 108.51 - 1.8141 - 86.9138 = 19.7821$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 19.7821)$.", "ground_truth_answer": "C0 - P0 = 19.7821, Lower bound = 19.7821", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 108.51, 91.37, 1.86, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 19.7821, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0857", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.035$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.47$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.47) * q, dxi/dt = (xi^2 - 0.035*xi) / 1.47, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.47, 0.035, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0858", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 7.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.7750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0859", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.28$, $\\sigma_1 = 0.263$, and $\\sigma_2 = 0.19$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.20751 S_t^3 V_t + 0.04197 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.20751*S^3*V + 0.04197*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.20751 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 155.57, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.28 * dW1 + np.sqrt(1 - 0.28**2) * dZ\ndS = 0.0699 * S0 * dt + 0.263 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.19 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0699*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.20751*S0**3*V0 + 0.04197*S0**3*np.sqrt(V0))*dt + 3*0.263*S0**3*V0*dW1 + 0.19*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0860", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.039$ and volatility $\\sigma = 0.218$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 103.9$ at maturity $T = 1.8$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 103.9, 0)$.", "ground_truth_answer": "dV/dt + 0.039*S*dV/dS + 0.5*0.04752*S^2*d2V/dS2 - 0.039*V = 0, V(S, 1.8) = max(S - 103.9, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 103.9, 0.039, 0.218, 1.8\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0861", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 1.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 6.70e-07$, temporary impact is $\\eta = 2.30e-05$, and trader risk aversion is $\\lambda = 6.16e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.16e-05 \\times 0.09}{2.30e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(1.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.16e-05 * 0.09 / 2.3e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 1.9, 2.3e-05, 6.16e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0862", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 108.78$, paying a known discrete dividend $D = 2.54$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 90.13$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 108.78$, $D e^{-r t_D} = 2.4773$, and $K e^{-r T} = 85.7343$.\nTheoretical difference $C_0 - P_0 = 108.78 - 2.4773 - 85.7343 = 20.5684$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 20.5684)$.", "ground_truth_answer": "C0 - P0 = 20.5684, Lower bound = 20.5684", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 108.78, 90.13, 2.54, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 20.5684, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0863", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.025$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.58$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.58) * q, dxi/dt = (xi^2 - 0.025*xi) / 0.58, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.58, 0.025, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0864", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 2.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{2.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.5250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 2.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0865", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.16$, $\\sigma_1 = 0.24$, and $\\sigma_2 = 0.292$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0576 S_t^2 V_t + -0.02243 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0576*S^2*V + -0.02243*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0576 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 137.44, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.16 * dW1 + np.sqrt(1 - -0.16**2) * dZ\ndS = 0.0602 * S0 * dt + 0.24 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.292 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0602*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0576*S0**2*V0 + -0.02243*S0**2*np.sqrt(V0))*dt + 2*0.24*S0**2*V0*dW1 + 0.292*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0866", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.057$ and volatility $\\sigma = 0.335$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 88.6$ at maturity $T = 1.5$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 88.6, 0)$.", "ground_truth_answer": "dV/dt + 0.057*S*dV/dS + 0.5*0.11223*S^2*d2V/dS2 - 0.057*V = 0, V(S, 1.5) = max(S - 88.6, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 88.6, 0.057, 0.335, 1.5\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0867", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 4.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.40e-07$, temporary impact is $\\eta = 2.22e-05$, and trader risk aversion is $\\lambda = 1.02e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.02e-05 \\times 0.09}{2.22e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(4.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1.02e-05 * 0.09 / 2.22e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 4.0, 2.22e-05, 1.02e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0868", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 108.29$, paying a known discrete dividend $D = 1.52$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 98.68$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 108.29$, $D e^{-r t_D} = 1.4825$, and $K e^{-r T} = 93.8673$.\nTheoretical difference $C_0 - P_0 = 108.29 - 1.4825 - 93.8673 = 12.9402$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 12.9402)$.", "ground_truth_answer": "C0 - P0 = 12.9402, Lower bound = 12.9402", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 108.29, 98.68, 1.52, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 12.9402, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0869", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.031$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.16$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.16) * q, dxi/dt = (xi^2 - 0.031*xi) / 1.16, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.16, 0.031, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0870", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 6.7$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.7}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.6750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.7\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0871", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.65$, $\\sigma_1 = 0.198$, and $\\sigma_2 = 0.243$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0392 S_t^2 V_t + -0.06255 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0392*S^2*V + -0.06255*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0392 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 141.99, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.65 * dW1 + np.sqrt(1 - -0.65**2) * dZ\ndS = 0.091 * S0 * dt + 0.198 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.243 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.091*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0392*S0**2*V0 + -0.06255*S0**2*np.sqrt(V0))*dt + 2*0.198*S0**2*V0*dW1 + 0.243*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0872", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.069$ and volatility $\\sigma = 0.163$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 116.5$ at maturity $T = 0.54$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 116.5, 0)$.", "ground_truth_answer": "dV/dt + 0.069*S*dV/dS + 0.5*0.02657*S^2*d2V/dS2 - 0.069*V = 0, V(S, 0.54) = max(S - 116.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 116.5, 0.069, 0.163, 0.54\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0873", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 1.3$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.15e-06$, temporary impact is $\\eta = 1.43e-05$, and trader risk aversion is $\\lambda = 2.55e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{2.55e-05 \\times 0.09}{1.43e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(1.3) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(2.55e-05 * 0.09 / 1.43e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 1.3, 1.43e-05, 2.55e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0874", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 99.18$, paying a known discrete dividend $D = 2.21$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 104.65$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 99.18$, $D e^{-r t_D} = 2.1554$, and $K e^{-r T} = 99.5462$.\nTheoretical difference $C_0 - P_0 = 99.18 - 2.1554 - 99.5462 = -2.5216$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -2.5216, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 99.18, 104.65, 2.21, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -2.5216, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0875", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.034$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.06$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.06) * q, dxi/dt = (xi^2 - 0.034*xi) / 1.06, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.06, 0.034, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0876", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 8.7$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.7}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.1750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.7\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0877", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.48$, $\\sigma_1 = 0.337$, and $\\sigma_2 = 0.209$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.34071 S_t^3 V_t + -0.10142 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.34071*S^3*V + -0.10142*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.34071 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 170.76, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.48 * dW1 + np.sqrt(1 - -0.48**2) * dZ\ndS = 0.1058 * S0 * dt + 0.337 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.209 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.1058*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.34071*S0**3*V0 + -0.10142*S0**3*np.sqrt(V0))*dt + 3*0.337*S0**3*V0*dW1 + 0.209*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0878", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.051$ and volatility $\\sigma = 0.213$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 119.5$ at maturity $T = 0.94$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 119.5, 0)$.", "ground_truth_answer": "dV/dt + 0.051*S*dV/dS + 0.5*0.04537*S^2*d2V/dS2 - 0.051*V = 0, V(S, 0.94) = max(S - 119.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 119.5, 0.051, 0.213, 0.94\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0879", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 3.2$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.92e-06$, temporary impact is $\\eta = 4.61e-05$, and trader risk aversion is $\\lambda = 5.89e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.89e-05 \\times 0.09}{4.61e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(3.2) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.89e-05 * 0.09 / 4.61e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 3.2, 4.61e-05, 5.89e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0880", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 95.38$, paying a known discrete dividend $D = 2.79$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 97.37$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 95.38$, $D e^{-r t_D} = 2.7211$, and $K e^{-r T} = 92.6212$.\nTheoretical difference $C_0 - P_0 = 95.38 - 2.7211 - 92.6212 = 0.0377$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0377)$.", "ground_truth_answer": "C0 - P0 = 0.0377, Lower bound = 0.0377", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 95.38, 97.37, 2.79, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 0.0377, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0881", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.011$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.68$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.68) * q, dxi/dt = (xi^2 - 0.011*xi) / 1.68, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.68, 0.011, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0882", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 7.0$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{7.0}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.7500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 7.0\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0883", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.24$, $\\sigma_1 = 0.236$, and $\\sigma_2 = 0.189$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0557 S_t^2 V_t + 0.02141 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0557*S^2*V + 0.02141*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0557 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 87.26, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.24 * dW1 + np.sqrt(1 - 0.24**2) * dZ\ndS = 0.0964 * S0 * dt + 0.236 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.189 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0964*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0557*S0**2*V0 + 0.02141*S0**2*np.sqrt(V0))*dt + 2*0.236*S0**2*V0*dW1 + 0.189*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0884", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.067$ and volatility $\\sigma = 0.255$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 100.0$ at maturity $T = 1.68$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 100.0, 0)$.", "ground_truth_answer": "dV/dt + 0.067*S*dV/dS + 0.5*0.06502*S^2*d2V/dS2 - 0.067*V = 0, V(S, 1.68) = max(S - 100.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 100.0, 0.067, 0.255, 1.68\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0885", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 1.2$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.10e-07$, temporary impact is $\\eta = 1.58e-05$, and trader risk aversion is $\\lambda = 5.08e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.08e-05 \\times 0.09}{1.58e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(1.2) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.08e-05 * 0.09 / 1.58e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 1.2, 1.58e-05, 5.08e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0886", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 99.82$, paying a known discrete dividend $D = 1.21$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 108.54$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 99.82$, $D e^{-r t_D} = 1.1801$, and $K e^{-r T} = 103.2464$.\nTheoretical difference $C_0 - P_0 = 99.82 - 1.1801 - 103.2464 = -4.6065$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -4.6065, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 99.82, 108.54, 1.21, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -4.6065, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0887", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.039$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.52$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.52) * q, dxi/dt = (xi^2 - 0.039*xi) / 0.52, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.52, 0.039, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0888", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 4.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.0250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0889", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.26$, $\\sigma_1 = 0.164$, and $\\sigma_2 = 0.137$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0269 S_t^2 V_t + 0.01168 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0269*S^2*V + 0.01168*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0269 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 73.92, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.26 * dW1 + np.sqrt(1 - 0.26**2) * dZ\ndS = 0.0528 * S0 * dt + 0.164 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.137 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0528*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0269*S0**2*V0 + 0.01168*S0**2*np.sqrt(V0))*dt + 2*0.164*S0**2*V0*dW1 + 0.137*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0890", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.063$ and volatility $\\sigma = 0.357$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 97.8$ at maturity $T = 1.71$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 97.8, 0)$.", "ground_truth_answer": "dV/dt + 0.063*S*dV/dS + 0.5*0.12745*S^2*d2V/dS2 - 0.063*V = 0, V(S, 1.71) = max(S - 97.8, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 97.8, 0.063, 0.357, 1.71\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0891", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.1$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.62e-06$, temporary impact is $\\eta = 1.32e-05$, and trader risk aversion is $\\lambda = 5.20e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.20e-05 \\times 0.09}{1.32e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.1) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.2e-05 * 0.09 / 1.32e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.1, 1.32e-05, 5.2e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0892", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 97.14$, paying a known discrete dividend $D = 2.66$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 97.08$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 97.14$, $D e^{-r t_D} = 2.5943$, and $K e^{-r T} = 92.3454$.\nTheoretical difference $C_0 - P_0 = 97.14 - 2.5943 - 92.3454 = 2.2003$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 2.2003)$.", "ground_truth_answer": "C0 - P0 = 2.2003, Lower bound = 2.2003", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 97.14, 97.08, 2.66, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 2.2003, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0893", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.043$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.82$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.82) * q, dxi/dt = (xi^2 - 0.043*xi) / 0.82, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.82, 0.043, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0894", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 9.6$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.6}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.4000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.6\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0895", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.6$, $\\sigma_1 = 0.251$, and $\\sigma_2 = 0.288$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.063 S_t^2 V_t + 0.08675 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.063*S^2*V + 0.08675*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.063 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 99.01, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.6 * dW1 + np.sqrt(1 - 0.6**2) * dZ\ndS = 0.0684 * S0 * dt + 0.251 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.288 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0684*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.063*S0**2*V0 + 0.08675*S0**2*np.sqrt(V0))*dt + 2*0.251*S0**2*V0*dW1 + 0.288*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0896", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.074$ and volatility $\\sigma = 0.169$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 113.2$ at maturity $T = 1.02$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 113.2, 0)$.", "ground_truth_answer": "dV/dt + 0.074*S*dV/dS + 0.5*0.02856*S^2*d2V/dS2 - 0.074*V = 0, V(S, 1.02) = max(S - 113.2, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 113.2, 0.074, 0.169, 1.02\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0897", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 4.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.31e-06$, temporary impact is $\\eta = 3.42e-05$, and trader risk aversion is $\\lambda = 8.40e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{8.40e-05 \\times 0.09}{3.42e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(4.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(8.4e-05 * 0.09 / 3.42e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 4.4, 3.42e-05, 8.4e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0898", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 104.97$, paying a known discrete dividend $D = 2.22$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 98.78$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 104.97$, $D e^{-r t_D} = 2.1652$, and $K e^{-r T} = 93.9624$.\nTheoretical difference $C_0 - P_0 = 104.97 - 2.1652 - 93.9624 = 8.8424$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 8.8424)$.", "ground_truth_answer": "C0 - P0 = 8.8424, Lower bound = 8.8424", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 104.97, 98.78, 2.22, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 8.8424, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0899", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.028$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.12$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.12) * q, dxi/dt = (xi^2 - 0.028*xi) / 1.12, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.12, 0.028, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0900", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 5.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.2750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0901", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.05$, $\\sigma_1 = 0.298$, and $\\sigma_2 = 0.273$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.26641 S_t^3 V_t + 0.0122 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.26641*S^3*V + 0.0122*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.26641 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 123.41, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.05 * dW1 + np.sqrt(1 - 0.05**2) * dZ\ndS = 0.0744 * S0 * dt + 0.298 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.273 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0744*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.26641*S0**3*V0 + 0.0122*S0**3*np.sqrt(V0))*dt + 3*0.298*S0**3*V0*dW1 + 0.273*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0902", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.051$ and volatility $\\sigma = 0.19$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 83.3$ at maturity $T = 0.53$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 83.3, 0)$.", "ground_truth_answer": "dV/dt + 0.051*S*dV/dS + 0.5*0.03610*S^2*d2V/dS2 - 0.051*V = 0, V(S, 0.53) = max(S - 83.3, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 83.3, 0.051, 0.19, 0.53\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0903", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 3.5$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.69e-06$, temporary impact is $\\eta = 4.42e-05$, and trader risk aversion is $\\lambda = 1.30e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.30e-05 \\times 0.09}{4.42e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(3.5) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1.3e-05 * 0.09 / 4.42e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 3.5, 4.42e-05, 1.3e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0904", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 101.64$, paying a known discrete dividend $D = 1.42$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 92.37$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 101.64$, $D e^{-r t_D} = 1.3849$, and $K e^{-r T} = 87.8651$.\nTheoretical difference $C_0 - P_0 = 101.64 - 1.3849 - 87.8651 = 12.3900$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 12.3900)$.", "ground_truth_answer": "C0 - P0 = 12.3900, Lower bound = 12.3900", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 101.64, 92.37, 1.42, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 12.39, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0905", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.02$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.59$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.59) * q, dxi/dt = (xi^2 - 0.02*xi) / 0.59, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.59, 0.02, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0906", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 4.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.0250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0907", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.14$, $\\sigma_1 = 0.264$, and $\\sigma_2 = 0.297$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0697 S_t^2 V_t + -0.02195 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0697*S^2*V + -0.02195*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0697 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 100.35, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.14 * dW1 + np.sqrt(1 - -0.14**2) * dZ\ndS = 0.1 * S0 * dt + 0.264 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.297 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0697*S0**2*V0 + -0.02195*S0**2*np.sqrt(V0))*dt + 2*0.264*S0**2*V0*dW1 + 0.297*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0908", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.046$ and volatility $\\sigma = 0.285$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 107.9$ at maturity $T = 1.55$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 107.9, 0)$.", "ground_truth_answer": "dV/dt + 0.046*S*dV/dS + 0.5*0.08122*S^2*d2V/dS2 - 0.046*V = 0, V(S, 1.55) = max(S - 107.9, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 107.9, 0.046, 0.285, 1.55\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0909", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.3$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.10e-06$, temporary impact is $\\eta = 1.71e-05$, and trader risk aversion is $\\lambda = 5.51e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.51e-05 \\times 0.09}{1.71e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.3) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.51e-05 * 0.09 / 1.71e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.3, 1.71e-05, 5.51e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0910", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 90.44$, paying a known discrete dividend $D = 2.39$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 108.90$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 90.44$, $D e^{-r t_D} = 2.331$, and $K e^{-r T} = 103.5889$.\nTheoretical difference $C_0 - P_0 = 90.44 - 2.331 - 103.5889 = -15.4799$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -15.4799, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 90.44, 108.9, 2.39, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -15.4799, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0911", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.015$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.01$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.01) * q, dxi/dt = (xi^2 - 0.015*xi) / 1.01, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.01, 0.015, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0912", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 6.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.5250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0913", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.72$, $\\sigma_1 = 0.286$, and $\\sigma_2 = 0.255$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0818 S_t^2 V_t + 0.10502 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0818*S^2*V + 0.10502*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0818 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 67.14, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.72 * dW1 + np.sqrt(1 - 0.72**2) * dZ\ndS = 0.1012 * S0 * dt + 0.286 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.255 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.1012*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0818*S0**2*V0 + 0.10502*S0**2*np.sqrt(V0))*dt + 2*0.286*S0**2*V0*dW1 + 0.255*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0914", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.021$ and volatility $\\sigma = 0.348$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 82.8$ at maturity $T = 1.21$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 82.8, 0)$.", "ground_truth_answer": "dV/dt + 0.021*S*dV/dS + 0.5*0.12110*S^2*d2V/dS2 - 0.021*V = 0, V(S, 1.21) = max(S - 82.8, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 82.8, 0.021, 0.348, 1.21\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0915", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 4.5$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.44e-06$, temporary impact is $\\eta = 1.19e-05$, and trader risk aversion is $\\lambda = 7.17e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.17e-05 \\times 0.09}{1.19e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(4.5) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.17e-05 * 0.09 / 1.19e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 4.5, 1.19e-05, 7.17e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0916", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 104.63$, paying a known discrete dividend $D = 2.51$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 103.95$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 104.63$, $D e^{-r t_D} = 2.448$, and $K e^{-r T} = 98.8803$.\nTheoretical difference $C_0 - P_0 = 104.63 - 2.448 - 98.8803 = 3.3017$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 3.3017)$.", "ground_truth_answer": "C0 - P0 = 3.3017, Lower bound = 3.3017", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 104.63, 103.95, 2.51, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 3.3017, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0917", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.043$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.76$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.76) * q, dxi/dt = (xi^2 - 0.043*xi) / 1.76, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.76, 0.043, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0918", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 3.0$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{3.0}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 0.7500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 3.0\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0919", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.15$, $\\sigma_1 = 0.252$, and $\\sigma_2 = 0.264$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0635 S_t^2 V_t + -0.01996 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0635*S^2*V + -0.01996*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0635 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 92.83, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.15 * dW1 + np.sqrt(1 - -0.15**2) * dZ\ndS = 0.0825 * S0 * dt + 0.252 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.264 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0825*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0635*S0**2*V0 + -0.01996*S0**2*np.sqrt(V0))*dt + 2*0.252*S0**2*V0*dW1 + 0.264*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0920", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.048$ and volatility $\\sigma = 0.169$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 95.5$ at maturity $T = 1.71$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 95.5, 0)$.", "ground_truth_answer": "dV/dt + 0.048*S*dV/dS + 0.5*0.02856*S^2*d2V/dS2 - 0.048*V = 0, V(S, 1.71) = max(S - 95.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 95.5, 0.048, 0.169, 1.71\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0921", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 2.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.48e-06$, temporary impact is $\\eta = 1.12e-05$, and trader risk aversion is $\\lambda = 5.20e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.20e-06 \\times 0.09}{1.12e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(2.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.2e-06 * 0.09 / 1.12e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 2.9, 1.12e-05, 5.2e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0922", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 93.63$, paying a known discrete dividend $D = 2.70$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 104.86$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 93.63$, $D e^{-r t_D} = 2.6333$, and $K e^{-r T} = 99.7459$.\nTheoretical difference $C_0 - P_0 = 93.63 - 2.6333 - 99.7459 = -8.7492$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -8.7492, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 93.63, 104.86, 2.7, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -8.7492, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0923", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.049$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.18$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.18) * q, dxi/dt = (xi^2 - 0.049*xi) / 1.18, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.18, 0.049, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0924", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 8.4$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.4}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.1000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.4\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0925", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.45$, $\\sigma_1 = 0.262$, and $\\sigma_2 = 0.164$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.20593 S_t^3 V_t + -0.05801 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.20593*S^3*V + -0.05801*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.20593 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 115.02, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.45 * dW1 + np.sqrt(1 - -0.45**2) * dZ\ndS = 0.1198 * S0 * dt + 0.262 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.164 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.1198*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.20593*S0**3*V0 + -0.05801*S0**3*np.sqrt(V0))*dt + 3*0.262*S0**3*V0*dW1 + 0.164*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0926", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.064$ and volatility $\\sigma = 0.302$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 108.3$ at maturity $T = 1.06$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 108.3, 0)$.", "ground_truth_answer": "dV/dt + 0.064*S*dV/dS + 0.5*0.09120*S^2*d2V/dS2 - 0.064*V = 0, V(S, 1.06) = max(S - 108.3, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 108.3, 0.064, 0.302, 1.06\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0927", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 1.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.32e-06$, temporary impact is $\\eta = 3.57e-05$, and trader risk aversion is $\\lambda = 1.80e-06$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{1.80e-06 \\times 0.09}{3.57e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(1.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(1.8e-06 * 0.09 / 3.57e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 1.9, 3.57e-05, 1.8e-06, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0928", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 103.23$, paying a known discrete dividend $D = 1.01$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 99.68$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 103.23$, $D e^{-r t_D} = 0.9851$, and $K e^{-r T} = 94.8185$.\nTheoretical difference $C_0 - P_0 = 103.23 - 0.9851 - 94.8185 = 7.4264$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 7.4264)$.", "ground_truth_answer": "C0 - P0 = 7.4264, Lower bound = 7.4264", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 103.23, 99.68, 1.01, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 7.4264, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0929", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.041$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.32$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.32) * q, dxi/dt = (xi^2 - 0.041*xi) / 1.32, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.32, 0.041, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0930", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 6.6$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{6.6}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.6500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 6.6\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0931", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.28$, $\\sigma_1 = 0.254$, and $\\sigma_2 = 0.17$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.19355 S_t^3 V_t + 0.03627 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.19355*S^3*V + 0.03627*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.19355 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 113.91, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.28 * dW1 + np.sqrt(1 - 0.28**2) * dZ\ndS = 0.0838 * S0 * dt + 0.254 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.17 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0838*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.19355*S0**3*V0 + 0.03627*S0**3*np.sqrt(V0))*dt + 3*0.254*S0**3*V0*dW1 + 0.17*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0932", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.028$ and volatility $\\sigma = 0.318$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 104.8$ at maturity $T = 1.61$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 104.8, 0)$.", "ground_truth_answer": "dV/dt + 0.028*S*dV/dS + 0.5*0.10112*S^2*d2V/dS2 - 0.028*V = 0, V(S, 1.61) = max(S - 104.8, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 104.8, 0.028, 0.318, 1.61\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0933", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 1.6$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.35e-06$, temporary impact is $\\eta = 1.80e-05$, and trader risk aversion is $\\lambda = 3.97e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{3.97e-05 \\times 0.09}{1.80e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(1.6) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(3.97e-05 * 0.09 / 1.8e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 1.6, 1.8e-05, 3.97e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0934", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 95.16$, paying a known discrete dividend $D = 1.87$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 102.11$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 95.16$, $D e^{-r t_D} = 1.8238$, and $K e^{-r T} = 97.13$.\nTheoretical difference $C_0 - P_0 = 95.16 - 1.8238 - 97.13 = -3.7938$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -3.7938, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 95.16, 102.11, 1.87, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -3.7938, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0935", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.046$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.37$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.37) * q, dxi/dt = (xi^2 - 0.046*xi) / 1.37, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.37, 0.046, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0936", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 8.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.0250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0937", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.14$, $\\sigma_1 = 0.293$, and $\\sigma_2 = 0.177$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.08585 S_t^2 V_t + 0.01452 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.08585*S^2*V + 0.01452*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.08585 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 96.04, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.14 * dW1 + np.sqrt(1 - 0.14**2) * dZ\ndS = 0.0732 * S0 * dt + 0.293 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.177 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0732*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.08585*S0**2*V0 + 0.01452*S0**2*np.sqrt(V0))*dt + 2*0.293*S0**2*V0*dW1 + 0.177*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0938", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.034$ and volatility $\\sigma = 0.204$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 97.0$ at maturity $T = 1.86$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 97.0, 0)$.", "ground_truth_answer": "dV/dt + 0.034*S*dV/dS + 0.5*0.04162*S^2*d2V/dS2 - 0.034*V = 0, V(S, 1.86) = max(S - 97.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 97.0, 0.034, 0.204, 1.86\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0939", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 2.5$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.02e-06$, temporary impact is $\\eta = 4.80e-06$, and trader risk aversion is $\\lambda = 6.99e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.99e-05 \\times 0.09}{4.80e-06}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(2.5) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.99e-05 * 0.09 / 4.8e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 2.5, 4.8e-06, 6.99e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0940", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 106.44$, paying a known discrete dividend $D = 2.59$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 103.19$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 106.44$, $D e^{-r t_D} = 2.5261$, and $K e^{-r T} = 98.1574$.\nTheoretical difference $C_0 - P_0 = 106.44 - 2.5261 - 98.1574 = 5.7565$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 5.7565)$.", "ground_truth_answer": "C0 - P0 = 5.7565, Lower bound = 5.7565", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 106.44, 103.19, 2.59, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 5.7565, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0941", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.038$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.9$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.9) * q, dxi/dt = (xi^2 - 0.038*xi) / 0.9, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.9, 0.038, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0942", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 8.0$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.0}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.0000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.0\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0943", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.35$, $\\sigma_1 = 0.315$, and $\\sigma_2 = 0.193$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09922 S_t^2 V_t + -0.04256 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.09922*S^2*V + -0.04256*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.09922 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 83.76, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.35 * dW1 + np.sqrt(1 - -0.35**2) * dZ\ndS = 0.0823 * S0 * dt + 0.315 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.193 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0823*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.09922*S0**2*V0 + -0.04256*S0**2*np.sqrt(V0))*dt + 2*0.315*S0**2*V0*dW1 + 0.193*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0944", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.056$ and volatility $\\sigma = 0.216$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 106.5$ at maturity $T = 1.72$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 106.5, 0)$.", "ground_truth_answer": "dV/dt + 0.056*S*dV/dS + 0.5*0.04666*S^2*d2V/dS2 - 0.056*V = 0, V(S, 1.72) = max(S - 106.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 106.5, 0.056, 0.216, 1.72\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0945", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 4.0$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.92e-06$, temporary impact is $\\eta = 3.95e-05$, and trader risk aversion is $\\lambda = 7.76e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.76e-05 \\times 0.09}{3.95e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(4.0) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.76e-05 * 0.09 / 3.95e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 4.0, 3.95e-05, 7.76e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0946", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 93.01$, paying a known discrete dividend $D = 1.93$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 94.34$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 93.01$, $D e^{-r t_D} = 1.8823$, and $K e^{-r T} = 89.739$.\nTheoretical difference $C_0 - P_0 = 93.01 - 1.8823 - 89.739 = 1.3887$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 1.3887)$.", "ground_truth_answer": "C0 - P0 = 1.3887, Lower bound = 1.3887", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 93.01, 94.34, 1.93, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 1.3887, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0947", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.011$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.82$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.82) * q, dxi/dt = (xi^2 - 0.011*xi) / 1.82, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.82, 0.011, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0948", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 8.6$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.6}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.1500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.6\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0949", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.48$, $\\sigma_1 = 0.307$, and $\\sigma_2 = 0.186$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.28275 S_t^3 V_t + -0.08223 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.28275*S^3*V + -0.08223*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.28275 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 144.51, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.48 * dW1 + np.sqrt(1 - -0.48**2) * dZ\ndS = 0.1086 * S0 * dt + 0.307 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.186 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.1086*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.28275*S0**3*V0 + -0.08223*S0**3*np.sqrt(V0))*dt + 3*0.307*S0**3*V0*dW1 + 0.186*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0950", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.04$ and volatility $\\sigma = 0.375$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 119.8$ at maturity $T = 1.74$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 119.8, 0)$.", "ground_truth_answer": "dV/dt + 0.04*S*dV/dS + 0.5*0.14062*S^2*d2V/dS2 - 0.04*V = 0, V(S, 1.74) = max(S - 119.8, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 119.8, 0.04, 0.375, 1.74\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0951", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 4.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 3.77e-06$, temporary impact is $\\eta = 4.08e-05$, and trader risk aversion is $\\lambda = 7.10e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.10e-05 \\times 0.09}{4.08e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(4.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.1e-05 * 0.09 / 4.08e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 4.9, 4.08e-05, 7.1e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0952", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 106.53$, paying a known discrete dividend $D = 2.87$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 108.06$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 106.53$, $D e^{-r t_D} = 2.7991$, and $K e^{-r T} = 102.7899$.\nTheoretical difference $C_0 - P_0 = 106.53 - 2.7991 - 102.7899 = 0.9410$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.9410)$.", "ground_truth_answer": "C0 - P0 = 0.9410, Lower bound = 0.9410", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 106.53, 108.06, 2.87, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 0.941, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0953", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.042$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.79$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.79) * q, dxi/dt = (xi^2 - 0.042*xi) / 1.79, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.79, 0.042, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0954", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 5.7$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.7}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.4250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.7\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0955", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.63$, $\\sigma_1 = 0.214$, and $\\sigma_2 = 0.292$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0458 S_t^2 V_t + 0.07873 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.0458*S^2*V + 0.07873*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.0458 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 135.67, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.63 * dW1 + np.sqrt(1 - 0.63**2) * dZ\ndS = 0.0643 * S0 * dt + 0.214 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.292 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0643*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.0458*S0**2*V0 + 0.07873*S0**2*np.sqrt(V0))*dt + 2*0.214*S0**2*V0*dW1 + 0.292*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0956", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.067$ and volatility $\\sigma = 0.292$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 92.5$ at maturity $T = 1.48$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 92.5, 0)$.", "ground_truth_answer": "dV/dt + 0.067*S*dV/dS + 0.5*0.08526*S^2*d2V/dS2 - 0.067*V = 0, V(S, 1.48) = max(S - 92.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 92.5, 0.067, 0.292, 1.48\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0957", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 3.8$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.80e-07$, temporary impact is $\\eta = 1.80e-06$, and trader risk aversion is $\\lambda = 9.17e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.17e-05 \\times 0.09}{1.80e-06}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(3.8) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.17e-05 * 0.09 / 1.8e-06)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 3.8, 1.8e-06, 9.17e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0958", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 96.18$, paying a known discrete dividend $D = 2.02$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 92.65$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 96.18$, $D e^{-r t_D} = 1.9701$, and $K e^{-r T} = 88.1314$.\nTheoretical difference $C_0 - P_0 = 96.18 - 1.9701 - 88.1314 = 6.0785$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 6.0785)$.", "ground_truth_answer": "C0 - P0 = 6.0785, Lower bound = 6.0785", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 96.18, 92.65, 2.02, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 6.0785, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0959", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.033$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.44$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.44) * q, dxi/dt = (xi^2 - 0.033*xi) / 1.44, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.44, 0.033, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0960", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 5.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{5.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.3000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 5.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0961", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.28$, $\\sigma_1 = 0.278$, and $\\sigma_2 = 0.247$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.07728 S_t^2 V_t + 0.03845 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.07728*S^2*V + 0.03845*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.07728 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 108.59, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.28 * dW1 + np.sqrt(1 - 0.28**2) * dZ\ndS = 0.0455 * S0 * dt + 0.278 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.247 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0455*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.07728*S0**2*V0 + 0.03845*S0**2*np.sqrt(V0))*dt + 2*0.278*S0**2*V0*dW1 + 0.247*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0962", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.043$ and volatility $\\sigma = 0.207$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 103.9$ at maturity $T = 1.89$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 103.9, 0)$.", "ground_truth_answer": "dV/dt + 0.043*S*dV/dS + 0.5*0.04285*S^2*d2V/dS2 - 0.043*V = 0, V(S, 1.89) = max(S - 103.9, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 103.9, 0.043, 0.207, 1.89\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0963", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 2.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.92e-06$, temporary impact is $\\eta = 3.13e-05$, and trader risk aversion is $\\lambda = 6.37e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{6.37e-05 \\times 0.09}{3.13e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(2.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(6.37e-05 * 0.09 / 3.13e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 2.9, 3.13e-05, 6.37e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0964", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 98.86$, paying a known discrete dividend $D = 2.72$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 99.88$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 98.86$, $D e^{-r t_D} = 2.6528$, and $K e^{-r T} = 95.0088$.\nTheoretical difference $C_0 - P_0 = 98.86 - 2.6528 - 95.0088 = 1.1984$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 1.1984)$.", "ground_truth_answer": "C0 - P0 = 1.1984, Lower bound = 1.1984", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 98.86, 99.88, 2.72, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 1.1984, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0965", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.039$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.39$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.39) * q, dxi/dt = (xi^2 - 0.039*xi) / 1.39, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.39, 0.039, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0966", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 9.6$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.6}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.4000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.6\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0967", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.68$, $\\sigma_1 = 0.323$, and $\\sigma_2 = 0.122$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.31299 S_t^3 V_t + 0.08039 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.31299*S^3*V + 0.08039*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.31299 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 174.92, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.68 * dW1 + np.sqrt(1 - 0.68**2) * dZ\ndS = 0.069 * S0 * dt + 0.323 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.122 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.069*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.31299*S0**3*V0 + 0.08039*S0**3*np.sqrt(V0))*dt + 3*0.323*S0**3*V0*dW1 + 0.122*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0968", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.05$ and volatility $\\sigma = 0.323$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 107.9$ at maturity $T = 1.47$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 107.9, 0)$.", "ground_truth_answer": "dV/dt + 0.05*S*dV/dS + 0.5*0.10433*S^2*d2V/dS2 - 0.05*V = 0, V(S, 1.47) = max(S - 107.9, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 107.9, 0.05, 0.323, 1.47\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0969", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 2.7$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.82e-06$, temporary impact is $\\eta = 3.76e-05$, and trader risk aversion is $\\lambda = 8.12e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{8.12e-05 \\times 0.09}{3.76e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(2.7) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(8.12e-05 * 0.09 / 3.76e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 2.7, 3.76e-05, 8.12e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0970", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 94.08$, paying a known discrete dividend $D = 2.16$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 90.85$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 94.08$, $D e^{-r t_D} = 2.1067$, and $K e^{-r T} = 86.4192$.\nTheoretical difference $C_0 - P_0 = 94.08 - 2.1067 - 86.4192 = 5.5541$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 5.5541)$.", "ground_truth_answer": "C0 - P0 = 5.5541, Lower bound = 5.5541", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 94.08, 90.85, 2.16, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 5.5541, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0971", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 50$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.043$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.75$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.75) * q, dxi/dt = (xi^2 - 0.043*xi) / 0.75, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.75, 0.043, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0972", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 8.2$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.2}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.0500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.2\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0973", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.74$, $\\sigma_1 = 0.318$, and $\\sigma_2 = 0.261$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.10112 S_t^2 V_t + 0.12284 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.10112*S^2*V + 0.12284*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.10112 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 141.45, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.74 * dW1 + np.sqrt(1 - 0.74**2) * dZ\ndS = 0.096 * S0 * dt + 0.318 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.261 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.096*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.10112*S0**2*V0 + 0.12284*S0**2*np.sqrt(V0))*dt + 2*0.318*S0**2*V0*dW1 + 0.261*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0974", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.058$ and volatility $\\sigma = 0.388$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 115.3$ at maturity $T = 1.38$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 115.3, 0)$.", "ground_truth_answer": "dV/dt + 0.058*S*dV/dS + 0.5*0.15054*S^2*d2V/dS2 - 0.058*V = 0, V(S, 1.38) = max(S - 115.3, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 115.3, 0.058, 0.388, 1.38\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0975", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 3.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 1.46e-06$, temporary impact is $\\eta = 4.61e-05$, and trader risk aversion is $\\lambda = 5.87e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.87e-05 \\times 0.09}{4.61e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(3.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.87e-05 * 0.09 / 4.61e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 3.4, 4.61e-05, 5.87e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0976", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 97.10$, paying a known discrete dividend $D = 1.06$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 91.04$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 97.1$, $D e^{-r t_D} = 1.0338$, and $K e^{-r T} = 86.5999$.\nTheoretical difference $C_0 - P_0 = 97.1 - 1.0338 - 86.5999 = 9.4663$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 9.4663)$.", "ground_truth_answer": "C0 - P0 = 9.4663, Lower bound = 9.4663", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 97.1, 91.04, 1.06, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 9.4663, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0977", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.013$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.41$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.41) * q, dxi/dt = (xi^2 - 0.013*xi) / 1.41, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.41, 0.013, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0978", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 8$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{8}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{8 \\times 8}$, and budget constraint $\\sum_{i=1}^{8} x_i = B$ with penalty weight $\\lambda_B = 9.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{8} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.2750, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 8\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0979", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.49$, $\\sigma_1 = 0.323$, and $\\sigma_2 = 0.277$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.10433 S_t^2 V_t + -0.08768 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.10433*S^2*V + -0.08768*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.10433 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 148.86, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.49 * dW1 + np.sqrt(1 - -0.49**2) * dZ\ndS = 0.0569 * S0 * dt + 0.323 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.277 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0569*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.10433*S0**2*V0 + -0.08768*S0**2*np.sqrt(V0))*dt + 2*0.323*S0**2*V0*dW1 + 0.277*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0980", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.068$ and volatility $\\sigma = 0.371$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 85.0$ at maturity $T = 0.8$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 85.0, 0)$.", "ground_truth_answer": "dV/dt + 0.068*S*dV/dS + 0.5*0.13764*S^2*d2V/dS2 - 0.068*V = 0, V(S, 0.8) = max(S - 85.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 85.0, 0.068, 0.371, 0.8\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0981", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 2.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.50e-06$, temporary impact is $\\eta = 3.15e-05$, and trader risk aversion is $\\lambda = 9.74e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{9.74e-05 \\times 0.09}{3.15e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(2.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(9.74e-05 * 0.09 / 3.15e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 2.9, 3.15e-05, 9.74e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0982", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 106.95$, paying a known discrete dividend $D = 1.67$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 91.25$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 106.95$, $D e^{-r t_D} = 1.6288$, and $K e^{-r T} = 86.7997$.\nTheoretical difference $C_0 - P_0 = 106.95 - 1.6288 - 86.7997 = 18.5215$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 18.5215)$.", "ground_truth_answer": "C0 - P0 = 18.5215, Lower bound = 18.5215", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 106.95, 91.25, 1.67, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 18.5215, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0983", "domain": "mean_field_games_and_liquidity", "difficulty": "expert", "problem_statement": "Consider a continuum of $N = 200$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.027$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 1.09$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 1.09) * q, dxi/dt = (xi^2 - 0.027*xi) / 1.09, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 1.09, 0.027, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0984", "domain": "quantum_finance_and_ising_formulation", "difficulty": "expert", "problem_statement": "Consider a portfolio selection problem across $N = 4$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{4}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{4 \\times 4}$, and budget constraint $\\sum_{i=1}^{4} x_i = B$ with penalty weight $\\lambda_B = 8.8$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{4} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{8.8}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.2000, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 4\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 8.8\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0985", "domain": "stochastic_calculus", "difficulty": "phd_level", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.46$, $\\sigma_1 = 0.227$, and $\\sigma_2 = 0.114$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.15459 S_t^3 V_t + -0.03571 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.15459*S^3*V + -0.03571*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.15459 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 190.69, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.46 * dW1 + np.sqrt(1 - -0.46**2) * dZ\ndS = 0.0468 * S0 * dt + 0.227 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.114 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.0468*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.15459*S0**3*V0 + -0.03571*S0**3*np.sqrt(V0))*dt + 3*0.227*S0**3*V0*dW1 + 0.114*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0986", "domain": "pde_and_martingale_pricing", "difficulty": "phd_level", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.048$ and volatility $\\sigma = 0.164$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 117.7$ at maturity $T = 0.61$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 117.7, 0)$.", "ground_truth_answer": "dV/dt + 0.048*S*dV/dS + 0.5*0.02690*S^2*d2V/dS2 - 0.048*V = 0, V(S, 0.61) = max(S - 117.7, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 117.7, 0.048, 0.164, 0.61\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0987", "domain": "optimal_execution_and_microstructure", "difficulty": "phd_level", "problem_statement": "An institutional trader must liquidate $X_0 = 1,000,000$ shares over horizon $T = 4.9$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 8.20e-07$, temporary impact is $\\eta = 4.87e-05$, and trader risk aversion is $\\lambda = 7.62e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{7.62e-05 \\times 0.09}{4.87e-05}}$.\nEnforcing boundary conditions $x(0) = 1,000,000$ and $x(4.9) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 1000000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(7.62e-05 * 0.09 / 4.87e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 1000000, 4.9, 4.87e-05, 7.62e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0988", "domain": "arbitrage_bounds_and_hedging", "difficulty": "phd_level", "problem_statement": "Let an underlying equity trade at spot $S_0 = 98.79$, paying a known discrete dividend $D = 2.60$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 95.57$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 98.79$, $D e^{-r t_D} = 2.5358$, and $K e^{-r T} = 90.909$.\nTheoretical difference $C_0 - P_0 = 98.79 - 2.5358 - 90.909 = 5.3452$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 5.3452)$.", "ground_truth_answer": "C0 - P0 = 5.3452, Lower bound = 5.3452", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 98.79, 95.57, 2.6, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 5.3452, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0989", "domain": "mean_field_games_and_liquidity", "difficulty": "phd_level", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.035$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.83$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.83) * q, dxi/dt = (xi^2 - 0.035*xi) / 0.83, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.83, 0.035, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0990", "domain": "quantum_finance_and_ising_formulation", "difficulty": "phd_level", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 4.1$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{4.1}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 1.0250, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 4.1\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0991", "domain": "stochastic_calculus", "difficulty": "advanced", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = 0.49$, $\\sigma_1 = 0.163$, and $\\sigma_2 = 0.142$.\nDerive the exact stochastic differential $d(S_t^2 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.02657 S_t^2 V_t + 0.02268 S_t^2 \\sqrt{V_t}$.\nThe diffusion components are $2 \\sigma_1 S_t^2 V_t dW_{1,t} + \\sigma_2 S_t^2 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [2*mu*S^2*V + S^2*kappa*(theta-V) + 0.02657*S^2*V + 0.02268*S^2*sqrt(V)]dt + 2*sigma1*S^2*V*dW1 + sigma2*S^2*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^2 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 2 S^{1} V$, $\\frac{\\partial f}{\\partial V} = S^2$, $\\frac{\\partial^2 f}{\\partial S^2} = 2 S^{0} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 2 S^{1}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 2 \\mu S_t^2 V_t + S_t^2 \\kappa(\\theta - V_t) + 0.02657 S_t^2 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 103.3, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = 0.49 * dW1 + np.sqrt(1 - 0.49**2) * dZ\ndS = 0.0939 * S0 * dt + 0.163 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.142 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**2 * (V0 + dV) - S0**2 * V0\nd_theoretical = (2*0.0939*S0**2*V0 + S0**2*1.5*(0.04-V0) + 0.02657*S0**2*V0 + 0.02268*S0**2*np.sqrt(V0))*dt + 2*0.163*S0**2*V0*dW1 + 0.142*S0**2*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0992", "domain": "pde_and_martingale_pricing", "difficulty": "advanced", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.067$ and volatility $\\sigma = 0.169$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 119.5$ at maturity $T = 0.91$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 119.5, 0)$.", "ground_truth_answer": "dV/dt + 0.067*S*dV/dS + 0.5*0.02856*S^2*d2V/dS2 - 0.067*V = 0, V(S, 0.91) = max(S - 119.5, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 119.5, 0.067, 0.169, 0.91\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0993", "domain": "optimal_execution_and_microstructure", "difficulty": "advanced", "problem_statement": "An institutional trader must liquidate $X_0 = 500,000$ shares over horizon $T = 4.2$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 2.47e-06$, temporary impact is $\\eta = 1.58e-05$, and trader risk aversion is $\\lambda = 5.68e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.68e-05 \\times 0.09}{1.58e-05}}$.\nEnforcing boundary conditions $x(0) = 500,000$ and $x(4.2) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 500000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.68e-05 * 0.09 / 1.58e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 500000, 4.2, 1.58e-05, 5.68e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-0994", "domain": "arbitrage_bounds_and_hedging", "difficulty": "advanced", "problem_statement": "Let an underlying equity trade at spot $S_0 = 92.74$, paying a known discrete dividend $D = 2.01$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 101.61$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 92.74$, $D e^{-r t_D} = 1.9604$, and $K e^{-r T} = 96.6544$.\nTheoretical difference $C_0 - P_0 = 92.74 - 1.9604 - 96.6544 = -5.8748$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 0.0000)$.", "ground_truth_answer": "C0 - P0 = -5.8748, Lower bound = 0.0000", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 92.74, 101.61, 2.01, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, -5.8748, atol=1e-3)"} {"problem_id": "QCOT-MEAN_-0995", "domain": "mean_field_games_and_liquidity", "difficulty": "advanced", "problem_statement": "Consider a continuum of $N = 100$ competitive institutional investors liquidating positions under common price impact. Representative agent inventory $q_t$ satisfies $dq_t = -v_t dt$. Price impact is aggregate: $P_t = P_0 - c \\overline{v}_t - \\sigma W_t$, where $\\overline{v}_t = \\int v_t d\\mu(q)$ is mean execution speed with $c = 0.022$. Cost functional is $J_i(v) = \\mathbb{E}\\left[\\int_0^T (q_t \\dot{P}_t + \\frac{\\alpha}{2} v_t^2) dt + \\frac{\\beta}{2} q_T^2\\right]$ with $\\alpha = 0.5$.\nFormulate the coupled Lasry-Lions Mean Field Game system (HJB equation for value function $u(t, q)$ and Fokker-Planck equation for density $m(t, q)$) and derive the Nash equilibrium optimal execution rate $v^*(t, q)$.", "ground_truth_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2: Differentiate with respect to $v$: $-p - \\alpha v = 0 \\implies v^* = -\\frac{p}{\\alpha} = -\\frac{1}{\\alpha} \\partial_q u(t, q)$.\nThe HJB equation becomes $\\partial_t u + \\frac{1}{2\\alpha} (\\partial_q u)^2 - c \\overline{v}(t) q = 0$ with terminal condition $u(T, q) = -\\frac{\\beta}{2} q^2$.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: Impose the Mean Field Game consistency condition $\\overline{v}(t) = -\\frac{1}{\\alpha} \\int \\partial_q u(t, q) m(t, q) dq$. Using the quadratic ansatz $u(t, q) = -\\frac{1}{2} \\xi(t) q^2$, $\\partial_q u = -\\xi(t) q$, yielding optimal feedback control $v^*(t, q) = \\frac{\\xi(t)}{\\alpha} q$, where $\\xi(t)$ solves the Riccati ODE $\\dot{\\xi} - \\frac{\\xi^2}{\\alpha} + c \\frac{\\xi}{\\alpha} = 0$.", "ground_truth_answer": "v*(t, q) = (xi(t) / 0.5) * q, dxi/dt = (xi^2 - 0.022*xi) / 0.5, xi(T) = beta", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the individual Hamilton-Jacobi-Bellman (HJB) equation. The Hamiltonian is $$H(q, p) = \\sup_{v} \\left[ -p v - \\frac{\\alpha}{2} v^2 - c \\overline{v}(t) q \\right]$$.\n\nStep 2 (Error): Solve the first-order condition with a sign error: $p - \\alpha v = 0 \\implies v^* = +\\frac{p}{\\alpha}$, causing agents to buy rather than sell as inventory increases.\n\nStep 3: Establish the forward continuity (Fokker-Planck) equation for the distribution of agent inventories $m(t, q)$:\n$$\\partial_t m - \\partial_q \\left( \\frac{1}{\\alpha} \\partial_q u \\cdot m \\right) = 0$$\nwith initial inventory distribution $m(0, q) = m_0(q)$.\n\nStep 4: This yields explosive positive inventory feedback $\\dot{q} > 0$ diverging from equilibrium.", "injected_error_step_index": 1, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nalpha, c, beta = 0.5, 0.022, 10.0\n# Solve Riccati ODE backward in time\ndt, steps = 0.001, 1000\nxi = np.zeros(steps)\nxi[-1] = beta\nfor t in range(steps - 2, -1, -1):\n dxi = (xi[t+1]**2 - c * xi[t+1]) / alpha\n xi[t] = xi[t+1] + dxi * dt\nprint('Equilibrium Riccati terminal/initial xi:', xi[-1], xi[0])"} {"problem_id": "QCOT-QUANT-0996", "domain": "quantum_finance_and_ising_formulation", "difficulty": "advanced", "problem_statement": "Consider a portfolio selection problem across $N = 6$ assets with binary selection variables $x_i \\in \\{0, 1\\}$, expected returns $\\mu \\in \\mathbb{R}^{6}$, covariance matrix $\\Sigma \\in \\mathbb{R}^{6 \\times 6}$, and budget constraint $\\sum_{i=1}^{6} x_i = B$ with penalty weight $\\lambda_B = 9.0$.\nConvert the quadratic unconstrained binary optimization (QUBO) objective $f(x) = \\frac{1}{2} x^T \\Sigma x - q \\mu^T x + \\lambda_B \\left(\\sum_{i=1}^{6} x_i - B\\right)^2$ into an Ising spin Hamiltonian $\\mathcal{H}_C = \\sum_{i} h_i \\hat{Z}_i + \\sum_{i < j} J_{ij} \\hat{Z}_i \\hat{Z}_j + C_0$ using the Pauli-Z substitution $x_i = \\frac{1 - \\hat{Z}_i}{2}$. Explicitly compute the two-qubit coupling matrix $J_{ij}$.", "ground_truth_cot": "Step 1: Apply the canonical mapping from binary bit $x_i \\in \\{0, 1\\}$ to spin variable $s_i \\in \\{+1, -1\\}$: $x_i = \\frac{1 - s_i}{2}$, which maps $x_i = 0 \\mapsto s_i = +1$ and $x_i = 1 \\mapsto s_i = -1$. Promote $s_i$ to quantum Pauli-Z observables $\\hat{Z}_i$ acting on qubit $i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: Collect coefficients for the pairwise coupling term $\\hat{Z}_i \\hat{Z}_j$. The quadratic matrix is $Q_{ij} = \\frac{1}{2} \\Sigma_{ij} + \\lambda_B$. Therefore, the Ising coupling coefficient is:\n$$J_{ij} = \\frac{1}{4} Q_{ij} = \\frac{1}{8} \\Sigma_{ij} + \\frac{9.0}{4}$$\nfor all $i < j$.\n\nStep 4: Collect linear coefficients $h_i = -\\frac{1}{2} Q_{ii} - \\frac{1}{4} \\sum_{j \\neq i} Q_{ij} + \\frac{q}{2} \\mu_i + \\lambda_B B$. The resulting cost Hamiltonian $\\mathcal{H}_C$ is diagonal in the computational basis $\\vert z \\rangle$, enabling ground state finding via the Quantum Approximate Optimization Algorithm (QAOA) with transverse mixer $\\mathcal{H}_M = \\sum_i \\hat{X}_i$.", "ground_truth_answer": "J_ij = (1/8)*Sigma_ij + 2.2500, x_i = (I - Z_i)/2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Use the incorrect substitution $x_i = \\frac{1 + \\hat{Z}_i}{2}$ which maps $x_i = 1 \\mapsto s_i = +1$, introducing an overall sign flip on all linear Pauli coefficients $h_i$.\n\nStep 2: Expand the quadratic risk and constraint terms. The quadratic interaction is $x_i x_j = \\left(\\frac{1 - \\hat{Z}_i}{2}\\right) \\left(\\frac{1 - \\hat{Z}_j}{2}\\right) = \\frac{1}{4} - \\frac{1}{4} \\hat{Z}_i - \\frac{1}{4} \\hat{Z}_j + \\frac{1}{4} \\hat{Z}_i \\hat{Z}_j$ for $i \\neq j$.\n\nStep 3: This inverts the ground state energy landscape, causing QAOA to converge to the worst portfolio rather than the optimal minimum variance portfolio.", "injected_error_step_index": 0, "injected_error_type": "pauli_matrix_commutation_error", "verification_code": "import numpy as np\nN = 6\nSigma = np.eye(N) * 0.04 + 0.01\nlam = 9.0\nQ = 0.5 * Sigma + lam * np.ones((N, N))\nJ = 0.25 * Q\nnp.fill_diagonal(J, 0.0)\nprint('Coupling matrix J shape:', J.shape, 'Sample J_01:', J[0, 1])"} {"problem_id": "QCOT-STOCH-0997", "domain": "stochastic_calculus", "difficulty": "expert", "problem_statement": "Let $S_t$ and $V_t$ be coupled stochastic processes governed by the It\u00f4 system:\n$$dS_t = \\mu S_t dt + \\sigma_1 S_t dW_{1,t}$$\n$$dV_t = \\kappa(\\theta - V_t) dt + \\sigma_2 \\sqrt{V_t} dW_{2,t}$$\nwith Brownian correlation $d\\langle W_1, W_2 \\rangle_t = \\rho dt$, where $\\rho = -0.35$, $\\sigma_1 = 0.229$, and $\\sigma_2 = 0.243$.\nDerive the exact stochastic differential $d(S_t^3 V_t)$ via the two-dimensional It\u00f4-Doeblin formula. Explicitly compute the total drift coefficient $\\alpha(S_t, V_t)$ and diffusion terms.", "ground_truth_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3: Evaluate the quadratic variations and covariations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, $d\\langle V \\rangle_t = \\sigma_2^2 V_t dt$, and $d\\langle S, V \\rangle_t = \\sigma_1 \\sigma_2 \\rho S_t \\sqrt{V_t} dt$.\n\nStep 4: Combine the drift terms:\nDrift coefficient $\\alpha(S_t, V_t) = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.15732 S_t^3 V_t + -0.05843 S_t^3 \\sqrt{V_t}$.\nThe diffusion components are $3 \\sigma_1 S_t^3 V_t dW_{1,t} + \\sigma_2 S_t^3 \\sqrt{V_t} dW_{2,t}$.", "ground_truth_answer": "df = [3*mu*S^3*V + S^3*kappa*(theta-V) + 0.15732*S^3*V + -0.05843*S^3*sqrt(V)]dt + 3*sigma1*S^3*V*dW1 + sigma2*S^3*sqrt(V)*dW2", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Define the bivariate transformation function $f(S, V) = S^3 V$. Compute all relevant first- and second-order partial derivatives:\n$\\frac{\\partial f}{\\partial S} = 3 S^{2} V$, $\\frac{\\partial f}{\\partial V} = S^3$, $\\frac{\\partial^2 f}{\\partial S^2} = 6 S^{1} V$, $\\frac{\\partial^2 f}{\\partial V^2} = 0$, and $\\frac{\\partial^2 f}{\\partial S \\partial V} = 3 S^{2}$.\n\nStep 2: Apply the bivariate It\u00f4-Doeblin formula:\n$$df = \\frac{\\partial f}{\\partial S} dS + \\frac{\\partial f}{\\partial V} dV + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial S^2} d\\langle S \\rangle_t + \\frac{1}{2} \\frac{\\partial^2 f}{\\partial V^2} d\\langle V \\rangle_t + \\frac{\\partial^2 f}{\\partial S \\partial V} d\\langle S, V \\rangle_t$$.\n\nStep 3 (Error): Evaluate the quadratic variations:\n$d\\langle S \\rangle_t = \\sigma_1^2 S_t^2 dt$, and $d\\langle S, V \\rangle_t = 0$ since $W_1$ and $W_2$ are independent Brownian motions.\n\nStep 4: Consequently, drift $\\alpha = 3 \\mu S_t^3 V_t + S_t^3 \\kappa(\\theta - V_t) + 0.15732 S_t^3 V_t$ without cross-covariance.", "injected_error_step_index": 2, "injected_error_type": "ito_cross_variation_omission", "verification_code": "import numpy as np\n# Verification via Monte Carlo Euler-Maruyama\nS0, V0, dt, N = 116.26, 0.04, 1e-4, 50000\ndW1 = np.random.normal(0, np.sqrt(dt), N)\ndZ = np.random.normal(0, np.sqrt(dt), N)\ndW2 = -0.35 * dW1 + np.sqrt(1 - -0.35**2) * dZ\ndS = 0.1187 * S0 * dt + 0.229 * S0 * dW1\ndV = 1.5 * (0.04 - V0) * dt + 0.243 * np.sqrt(V0) * dW2\nd_actual = (S0 + dS)**3 * (V0 + dV) - S0**3 * V0\nd_theoretical = (3*0.1187*S0**3*V0 + S0**3*1.5*(0.04-V0) + 0.15732*S0**3*V0 + -0.05843*S0**3*np.sqrt(V0))*dt + 3*0.229*S0**3*V0*dW1 + 0.243*S0**3*np.sqrt(V0)*dW2\nprint('Mean error:', np.abs(np.mean(d_actual - d_theoretical)))"} {"problem_id": "QCOT-PDE_A-0998", "domain": "pde_and_martingale_pricing", "difficulty": "expert", "problem_statement": "Consider a financial derivative $V(S, t)$ on an underlying asset $dS_t = \\mu S_t dt + \\sigma S_t dW_t$, with constant risk-free rate $r = 0.048$ and volatility $\\sigma = 0.331$.\nConstruct a self-financing delta-hedged portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$ to eliminate stochastic risk. Derive the Black-Scholes-Merton partial differential equation and state the Cauchy terminal boundary condition for a European call option with strike $K = 103.0$ at maturity $T = 1.5$.", "ground_truth_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4: By the absence of arbitrage, the riskless portfolio must yield the risk-free rate $r$, so $d\\Pi_t = r \\Pi_t dt = r\\left(V - S \\frac{\\partial V}{\\partial S}\\right) dt$.\nEquating expressions gives the Black-Scholes PDE:\n$$\\frac{\\partial V}{\\partial t} + r S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - r V = 0$$\nwith European call terminal condition $V(S, T) = \\max(S - 103.0, 0)$.", "ground_truth_answer": "dV/dt + 0.048*S*dV/dS + 0.5*0.10956*S^2*d2V/dS2 - 0.048*V = 0, V(S, 1.5) = max(S - 103.0, 0)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Set up the replicating portfolio $\\Pi_t = V(S_t, t) - \\Delta_t S_t$. Over an infinitesimal interval $dt$, the portfolio change is $d\\Pi_t = dV_t - \\Delta_t dS_t$ under the self-financing condition.\n\nStep 2: Expand $dV(S_t, t)$ via It\u00f4's formula:\n$$dV = \\left(\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt + \\sigma S \\frac{\\partial V}{\\partial S} dW_t$$.\n\nStep 3: Substitute $dV$ into $d\\Pi_t$ and choose $\\Delta_t = \\frac{\\partial V}{\\partial S}$ to eliminate the stochastic Brownian term $\\sigma S \\frac{\\partial V}{\\partial S} dW_t$. This leaves deterministic growth $d\\Pi_t = \\left(\\frac{\\partial V}{\\partial t} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2}\\right) dt$.\n\nStep 4 (Error): Equate $d\\Pi_t = \\mu \\Pi_t dt$ using the objective drift $\\mu$, yielding $\\frac{\\partial V}{\\partial t} + \\mu S \\frac{\\partial V}{\\partial S} + \\frac{1}{2} \\sigma^2 S^2 \\frac{\\partial^2 V}{\\partial S^2} - \\mu V = 0$.", "injected_error_step_index": 3, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nfrom scipy.stats import norm\nS, K, r, sigma, T = 100.0, 103.0, 0.048, 0.331, 1.5\nd1 = (np.log(S/K) + (r + 0.5*sigma**2)*T) / (sigma*np.sqrt(T))\nd2 = d1 - sigma*np.sqrt(T)\ncall_price = S*norm.cdf(d1) - K*np.exp(-r*T)*norm.cdf(d2)\nprint('Analytical European Call price:', call_price)"} {"problem_id": "QCOT-OPTIM-0999", "domain": "optimal_execution_and_microstructure", "difficulty": "expert", "problem_statement": "An institutional trader must liquidate $X_0 = 100,000$ shares over horizon $T = 4.4$ days. Price dynamics follow $S_t = S_0 - \\gamma(X_0 - x_t) + \\sigma W_t - \\eta v_t$, where $v_t = -\\dot{x}_t$ is trading speed, permanent price impact is $\\gamma = 4.32e-06$, temporary impact is $\\eta = 1.64e-05$, and trader risk aversion is $\\lambda = 5.43e-05$ with volatility $\\sigma = 0.30$.\nFormulate the Almgren-Chriss calculus of variations functional $J[x(t)] = \\mathbb{E}[\\text{Cost}] + \\lambda \\mathbb{V}[\\text{Cost}]$ and derive the optimal liquidation trajectory $x^*(t)$ via the Euler-Lagrange equation.", "ground_truth_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3: Compute functional derivatives:\n$\\frac{\\partial L}{\\partial x} = 2 \\lambda \\sigma^2 x$, $\\frac{\\partial L}{\\partial \\dot{x}} = 2 \\eta \\dot{x}$, and $\\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 2 \\eta \\ddot{x}$.\n\nStep 4: Substitute into the Euler-Lagrange equation:\n$$2 \\lambda \\sigma^2 x - 2 \\eta \\ddot{x} = 0 \\implies \\ddot{x}(t) = \\kappa^2 x(t)$$\nwhere urgency parameter $\\kappa = \\sqrt{\\frac{\\lambda \\sigma^2}{\\eta}} = \\sqrt{\\frac{5.43e-05 \\times 0.09}{1.64e-05}}$.\nEnforcing boundary conditions $x(0) = 100,000$ and $x(4.4) = 0$, the unique solution is $$x^*(t) = X_0 \\frac{\\sinh(\\kappa(T - t))}{\\sinh(\\kappa T)}$$.", "ground_truth_answer": "x*(t) = 100000 * sinh(kappa*(T - t)) / sinh(kappa*T), kappa = sqrt(5.43e-05 * 0.09 / 1.64e-05)", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1: Express total execution cost and variance. The expected cost is $\\mathbb{E}[\\text{Cost}] = \\frac{1}{2} \\gamma X_0^2 + \\int_0^T \\eta \\dot{x}_t^2 dt$. The capture variance is $\\mathbb{V}[\\text{Cost}] = \\sigma^2 \\int_0^T x_t^2 dt$.\n\nStep 2: Construct the Lagrangian functional:\n$$L(t, x, \\dot{x}) = \\eta \\dot{x}^2 + \\lambda \\sigma^2 x^2$$.\nThe Euler-Lagrange necessary condition requires $\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\left(\\frac{\\partial L}{\\partial \\dot{x}}\\right) = 0$.\n\nStep 3 (Error): Differentiate the Lagrangian with an incorrect sign:\n$\\frac{\\partial L}{\\partial x} - \\frac{d}{dt}\\frac{\\partial L}{\\partial \\dot{x}} = 0 \\implies 2\\lambda\\sigma^2 x + 2\\eta \\ddot{x} = 0$ yielding oscillatory trajectory $\\ddot{x} = -\\kappa^2 x$.\n\nStep 4: This yields harmonic liquidation $x(t) = X_0 \\cos(\\kappa t)$, which fluctuates indefinitely.", "injected_error_step_index": 2, "injected_error_type": "euler_lagrange_sign_error", "verification_code": "import numpy as np\nX0, T, eta, lam, sigma = 100000, 4.4, 1.64e-05, 5.43e-05, 0.30\nkappa = np.sqrt(lam * sigma**2 / eta)\nt = np.linspace(0, T, 100)\nx_opt = X0 * np.sinh(kappa * (T - t)) / np.sinh(kappa * T)\nassert np.isclose(x_opt[0], X0) and np.isclose(x_opt[-1], 0.0)\nprint('Optimal Almgren-Chriss liquidation trajectory verified. Kappa:', kappa)"} {"problem_id": "QCOT-ARBIT-1000", "domain": "arbitrage_bounds_and_hedging", "difficulty": "expert", "problem_statement": "Let an underlying equity trade at spot $S_0 = 109.79$, paying a known discrete dividend $D = 1.74$ at $t_D = 0.5$. Risk-free rate is $r = 0.05$.\nDerive the exact discrete-dividend Put-Call Parity formula for European options with strike $K = 107.79$ maturing at $T = 1.0$. Establish the analytical bounds on European call price $C_0$ and calculate the static arbitrage cash flow if market prices violate $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.", "ground_truth_cot": "Step 1: Construct Portfolio A consisting of one European call option $+C_0$ and cash balance $K e^{-r T} + D e^{-r t_D}$. Construct Portfolio B consisting of one European put option $+P_0$ and one share of underlying $+S_0$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: Since terminal payoffs are identical across all states of nature $\\omega \\in \\Omega$, the absence of arbitrage implies initial values must match:\n$$C_0 + K e^{-r T} + D e^{-r t_D} = P_0 + S_0$$\nRearranging gives Put-Call Parity: $C_0 - P_0 = S_0 - D e^{-r t_D} - K e^{-r T}$.\n\nStep 4: Substitute parameters: $S_0 = 109.79$, $D e^{-r t_D} = 1.697$, and $K e^{-r T} = 102.533$.\nTheoretical difference $C_0 - P_0 = 109.79 - 1.697 - 102.533 = 5.5600$. Lower bound on European call is $C_0 \\ge \\max(0, S_0 - D e^{-r t_D} - K e^{-r T} = 5.5600)$.", "ground_truth_answer": "C0 - P0 = 5.5600, Lower bound = 5.5600", "step_prm_labels": [1, 1, 1, 1], "injected_hallucination_cot": "Step 1 (Error): Construct Portfolio A with full undiscounted dividend $D$ rather than discounted present value $D e^{-r t_D}$.\n\nStep 2: Track terminal values at $T = 1.0$. At dividend date $t_D = 0.5$, the stock drops by $D$, but cash from Portfolio A yields $D$. At maturity $T$, Portfolio A has value $\\max(S_T - K, 0) + K = \\max(S_T, K)$. Portfolio B has value $\\max(K - S_T, 0) + S_T = \\max(S_T, K)$.\n\nStep 3: This leads to invalid parity $C_0 - P_0 = S_0 - D - K e^{-r T}$ ignoring interest accrued between $0$ and $t_D$.", "injected_error_step_index": 0, "injected_error_type": "drift_arbitrage_violation", "verification_code": "import numpy as np\nS0, K, D, r, tD, T = 109.79, 107.79, 1.74, 0.05, 0.5, 1.0\npv_D = D * np.exp(-r * tD)\npv_K = K * np.exp(-r * T)\nparity = S0 - pv_D - pv_K\nprint('Parity delta C - P:', parity)\nassert np.isclose(parity, 5.56, atol=1e-3)"}