0
$\begingroup$

With your help i am getting closer to the solution of my problem. I know that the code is long but most of it is boring definition. At the beginning i am just defining function, which works at the moment. Thank you for pointing out to use 1/2 instead of 0.5 and using "eqn" was also a step forward.

       p[A1] := 30
p[A2] := 30
p[B1] := 60
p[B2] := 60
p[A12] := 100
p[B12] := 70

a[l1] := 10
a[h1] := 40
b[l1] := 20
b[h1] := 50
a[l2] := 10
a[h2] := 40
b[l2] := 20
b[h2] := 50

(*all low*)
x = a[l1];
y = a[l2];
u = b[l1];
v = b[l2];

(*G[1,x_,y_] is probability of player a playing with 1 given 1 and 2 \
play with him*)
G[1, x_, y_] := 1 /; p[A12] - x - y >= p[A2] - y && p[A12] - x - y >= 0
G[1, x_, y_] := 1 /; p[A1] - x > p[A2] - y && p[A1] - x >= 0
G[1, x_, y_] := 1/2 /; p[A1] - x == p[A2] - y && p[A1] - x >= 0
G[1, x_, y_] := 0

(*A spielt mit 1 wenn nur 1*)
G[2, x_, y_] := 1 /;  p[A1] - x >= 0
G[2, x_, y_] := 0

(*A spielt mit 2 wenn beide*)
G[3, x_, y_] := 1 /; p[A12] - x - y >= p[A1] - x && p[A12] - x - y >= 0
G[3, x_, y_] := 1 /; p[A2] - y > p[A1] - x && p[A2] - y >= 0
G[3, x_, y_] := 1/2 /; p[A2] - y == p[A1] - x && p[A2] - y >= 0
G[3, x_, y_] := 0

(*A spielt mit 2 wenn nur 2*)
G[4, x_, y_] := 1 /;  p[A2] - y >= 0
G[4, x_, y_] := 0

(*B spielt mit 1 wenn beide*)
H[1, x_, y_] := 1 /; p[B12] - x - y >= p[B2] - y && p[B12] - x - y >= 0
H[1, x_, y_] := 1 /; p[B1] - x > p[B2] - y && p[B1] - x >= 0
H[1, x_, y_] := 1/2 /; p[B1] - x == p[B2] - y && p[B1] - x >= 0
H[1, x_, y_] := 0

(*B spielt mit 1 wenn nur 1*)
H[2, x_, y_] := 1 /;  p[B1] - x >= 0
H[2, x_, y_] := 0

(*B spielt mit 2 wenn beide*)
H[3, x_, y_] := 1 /; p[B12] - x - y >= p[B1] - x && p[B12] - x - y >= 0
H[3, x_, y_] := 1 /; p[B2] - y > p[B1] - x && p[B2] - y >= 0
H[3, x_, y_] := 1/2 /; p[B2] - y == p[B1] - x && p[B2] - y >= 0
H[3, x_, y_] := 0

(*B spielt mit 2 wenn nur 2*)
H[4, x_, y_] := 1 /;  p[B2] - y >= 0
H[4, x_, y_] := 0



(*Find Solution, l:= EV von 1 mit A, m:= 1 mit B, n:= 2 mit A, o:= 2 \
mit B*)
(*P[q_,w,] is probability that 1 selects A given bids u,v,x,y*)
P[q_, w_] := 1 /; q > w
P[q_, w_] := 1/2 /; q == w
P[q_, w_] := 0 /; q < w
(*U[q_,w,] is probability that 1 selects B given bids u,v,x,y*)
U[q_, w_] := 1 /; w > q
U[q_, w_] := 1/2 /; w == q
U[q_, w_] := 0 /; w < q

(*S[q_,w,] is probability that 2 selects A given bids u,v,x,y*)
S[f_, g_] := 1 /; f > g
S[f_, g_] := 1/2 /; f == g
S[f_, g_] := 0 /; f < g

(*S[q_,w,] is probability that 2 selects B given bids u,v,x,y*)
T[f_, g_] := 1 /; g > f
T[f_, g_] := 1/2 /; g == f
T[f_, g_] := 0 /; g < f

eqn = {l == S[n, c]*G[1, x, y]*x + (1 - S[n, c])*G[2, x, y]*x, 
  m == T[n, c]*H[1, u, v]*u + (1 - T[n, c])*H[2, u, v]*u, 
  n == P[l, m]*G[3, x, y]*y + (1 - P[l, m])*G[4, x, y]*y, 
  c == U[l, m]*H[3, u, v]*v + (1 - U[l, m])*H[4, u, v]*v}

Solve[eqn, {l, m, n, c}]

When trying to solve or reduce the final statement i get an error: "This system cannot be solved with the methods available to Solve. "

How can i get rid of this error and is there a way to get as output the S[n,c] aswell? By the way in my oppinion the solution should be unique.

$\endgroup$
  • $\begingroup$ Replace 0.5with 1/2. $\endgroup$ – user36273 Jun 1 '16 at 12:13
  • $\begingroup$ @rewi Thank you. I changed that, but my full code doesn't work yet. Any ideas? $\endgroup$ – Paul Jun 1 '16 at 13:06
  • $\begingroup$ I know that this code is very long, but i think the solution is not far away. Why does that solve not work? $\endgroup$ – Paul Jun 13 '16 at 14:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.