A (difficult) example (B.4)

[1]:
from fractions import Fraction
import sympy as sp
from poisson_approval import *
[2]:
tau = TauVector({'a': Fraction(3, 20), 'b': Fraction(9, 20), 'ac': Fraction(1, 20), 'bc': Fraction(7, 20)},
                symbolic=True)
[3]:
tau.pivot_weak_ab.mu
[3]:
$\displaystyle - \frac{1}{5}$
[4]:
tau.pivot_weak_bc.mu
[4]:
$\displaystyle - \frac{1}{5}$
[5]:
tau.pivot_weak_ac.mu
[5]:
$\displaystyle - \frac{7}{10} + \frac{\sqrt{21}}{10}$
[6]:
tau.trio.mu
[6]:
$\displaystyle - \frac{7}{10} + \frac{\sqrt{21}}{10}$
[7]:
float(tau.trio.mu)
[7]:
-0.241742430504416

\(\delta_{ab}(\tau)\):

[8]:
tau.score_ab_in_duo_ab - tau.score_c_in_duo_ab
[8]:
$\displaystyle \frac{1}{8}$

\(\delta_{bc}(\tau)\):

[9]:
tau.score_bc_in_duo_bc - tau.score_a_in_duo_bc
[9]:
$\displaystyle \frac{1}{5}$
[10]:
tau.pivot_weak_ab.psi_ac
[10]:
$\displaystyle 2$
[11]:
tau.pivot_weak_bc.psi_a
[11]:
$\displaystyle 1$
[12]:
tau.pivot_weak_bc.psi_b
[12]:
$\displaystyle \frac{1}{3}$
[13]:
tau.duo_ab.asymptotic
[13]:
exp(- n/5 - log(n)/2 - log(8*pi/5)/2 + o(1))
[14]:
tau.duo_bc.asymptotic
[14]:
exp(- n/5 - log(n)/2 - log(3*pi/5)/2 + o(1))
[15]:
utility_threshold_program = tau.d_ranking_best_response['abc'].utility_threshold
utility_threshold_program
[15]:
$\displaystyle \frac{27 \sqrt{2}}{16 \sqrt{3} + 27 \sqrt{2}}$
[16]:
utility_threshold_theoretical = 9 * sp.sqrt(3) / (9 * sp.sqrt(3) + 8 * sp.sqrt(2))
utility_threshold_theoretical
[16]:
$\displaystyle \frac{9 \sqrt{3}}{8 \sqrt{2} + 9 \sqrt{3}}$

Check that the value found by the program is actually the same as the theoretical value:

[17]:
sp.simplify(utility_threshold_program - utility_threshold_theoretical)
[17]:
$\displaystyle 0$