2
$\begingroup$

When I input the system of equations:

Block[{p, a, b, c, d, e, f, g}, 
      NSolve[{2*p == 2*p*a + (1 - 2 p)*b,
              a == (p)*d + 2*(p^2) + ((1/2) - p)*(b + c),
              b == (2*(p^2)) + ((1/2) - p)*(a + c) + p*g,
              c == ((1 - 2 p)/3)*(f + b + d) + (2*p/3)*(e + g + a),
              d == p + p*a + (1/2 - p)*(e + c),
              e == p + (1/2 - p)*(d + c) + p*f,
              f == p*e + (1/2 - p)*(g + c),
              g == p*b + (1/2 - p)*(c + f),
              0.5 >= p >= 0}
      ]
]

I get the solutions with $ p = 0.5 $ and $ p = 0 $. However, there is definitely a set of solutions for $ p = 0.25 $ as if I put $ p = 0.25 $ instead of $ 0.5 > p > 0 $ in I get a set of solutions. However, NSolve is not giving this solution to me automatically, and I was wondering if there might be others that I was missing and if there was any way to make sure I got these solutions. Thanks!

$\endgroup$
2
$\begingroup$
eqns = {2*p == 2*p*a + (1 - 2 p)*b, 
   a == (p)*d + 2*(p^2) + ((1/2) - p)*(b + c), 
   b == (2*(p^2)) + ((1/2) - p)*(a + c) + p*g, 
   c == ((1 - 2 p)/3)*(f + b + d) + (2*p/3)*(e + g + a), 
   d == p + p*a + (1/2 - p)*(e + c), e == p + (1/2 - p)*(d + c) + p*f, 
   f == p*e + (1/2 - p)*(g + c), g == p*b + (1/2 - p)*(c + f), 1/2 >= p >= 0};

Although NSolve[eqns] returns a result, the documentation specifies that the variables should be given. Doing so produces results with p having the values {0, 1/4, 1/2}.

sol = NSolve[eqns, {p, a, b, c, d, e, f, g}] /. x_Real :> RootApproximant[x] //
   Union

(* {{p -> 0, a -> 0, b -> 0, c -> 0, d -> 0, e -> 0, f -> 0, g -> 0}, {p -> 1/4, 
  a -> 8/15, b -> 7/15, c -> 1/2, d -> 2/3, e -> 19/30, f -> 11/30, 
  g -> 1/3}, {p -> 1/2, a -> 1, b -> 2/3, c -> 2/3, d -> 1, e -> 2/3, 
  f -> 1/3, g -> 1/3}} *)

Verifying,

eqns /. sol

(* {{True, True, True, True, True, True, True, True, True}, {True, True, True, 
  True, True, True, True, True, True}, {True, True, True, True, True, True, 
  True, True, True}} *)

Comparing with the results from Solve

sol2 = Solve[eqns, {p, a, b, c, d, e, f, g}, Reals]

(* {{p -> 0, a -> 0, b -> 0, c -> 0, d -> 0, e -> 0, f -> 0, g -> 0}, {p -> 1/4, 
  a -> 8/15, b -> 7/15, c -> 1/2, d -> 2/3, e -> 19/30, f -> 11/30, 
  g -> 1/3}, {p -> 1/2, a -> 1, b -> 2/3, c -> 2/3, d -> 1, e -> 2/3, 
  f -> 1/3, g -> 1/3}} *)

sol == sol2

(* True *)
| improve this answer | |
$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.