```python
import sympy as sym
import numpy as np

import testzd as zd
```

This notebook verifies the various algebraic steps required to prove the general form of an extortionate strategy $p\in\mathbb{R}^{4\times 1}$:


```python
tilde_p = sym.symbols("tilde_p1:5")
R, S, T, P = sym.symbols("R, S, T, P")
alpha, beta = sym.symbols("alpha, beta")
tilde_p
```




    (tilde_p1, tilde_p2, tilde_p3, tilde_p4)




```python
eqn_1 = sym.Eq(tilde_p[0], alpha * (R - P) + beta * (R - P))
eqn_2 = sym.Eq(tilde_p[1], alpha * (S - P) + beta * (T - P))
eqn_3 = sym.Eq(tilde_p[2], alpha * (T - P) + beta * (S - P))
eqn_4 = sym.Eq(tilde_p[3], 0)
```


```python
solved_alpha = sym.solveset(eqn_2, alpha).args[0]
solved_alpha
```




    (-beta*(P - T) - tilde_p2)/(P - S)



Formula for $\beta$:


```python
solved_beta = sym.solveset(eqn_3.subs({alpha: solved_alpha}), beta).args[0]
sym.simplify(solved_beta)
```




    (P*tilde_p2 - P*tilde_p3 + S*tilde_p3 - T*tilde_p2)/((S - T)*(-2*P + S + T))



Formula for $\alpha$:


```python
solved_alpha = solved_alpha.subs({beta: solved_beta})
sym.simplify(solved_alpha)
```




    (P*tilde_p2 - P*tilde_p3 - S*tilde_p2 + T*tilde_p3)/(2*P*S - 2*P*T - S**2 + T**2)



Formula for $p_1$:


```python
sym.simplify(eqn_1.subs({alpha: solved_alpha, beta: solved_beta}))
```




    Eq(tilde_p1, (P*tilde_p2 + P*tilde_p3 - R*tilde_p2 - R*tilde_p3)/(2*P - S - T))



Formula for $\chi$:


```python
sym.simplify(- solved_beta / solved_alpha)
```




    (P*tilde_p2 - P*tilde_p3 + S*tilde_p3 - T*tilde_p2)/(P*tilde_p2 - P*tilde_p3 - S*tilde_p2 + T*tilde_p3)



049022b6c45c4225db39ef0b58e20972e85f3efa
ipynb
Jupyter Notebook
assets/pdf/proof_of_form_of_extortionate_strategies/main.ipynb
drvinceknight/testing_for_ZD
a08643849a8e4ed3c1ee86ab8bd4530a97e92154
MIT
assets/pdf/proof_of_form_of_extortionate_strategies/main.ipynb
drvinceknight/testing_for_ZD
a08643849a8e4ed3c1ee86ab8bd4530a97e92154
MIT
2019-10-02T09:25:08.000Z
2022-02-27T20:48:06.000Z
assets/pdf/proof_of_form_of_extortionate_strategies/main.ipynb
drvinceknight/testing_for_ZD
a08643849a8e4ed3c1ee86ab8bd4530a97e92154
MIT
Qwen/Qwen-72B
1. YES
2. YES