3
$\begingroup$

It's been asserted to me that there are two forms of representing a certain variable q. One is more complicated than the other, but I've been told that they should deliver the same result.

The more complex form is:

q == (H (1 - H)/(a + c)) ((F (s - 1) s)/(F s - F - H s)^2)^2 + (F (1 - F)/(b + d)) (-(H (s - 1) s)/(F (s - 1) - H s)^2)^2

, where H == (a/(a + c)), F == (b/(b + d)), s == (a + c)/(a + b + c + d).

The simpler form is:

q == z^4((1-H)/a+(1-F)/b)a^2/b^2

, where in addition the variables I've previously defined we also have z == (b/(a + b)).

I've tested various input values on the two forms, and they seem to always produce the same result. I wrote some code before that has worked in similar contexts. However, here Mathematica just runs for hours without reaching an answer.

Eliminate[{q == (H (1 - H)/(a + c)) ((F (s - 1) s)/(F s - F - H s)^2)^2 + (F (1 - F)/(b + d)) (-(H (s - 1) s)/(F (s - 1) - H s)^2)^2, H == (a/(a + c)), F == (b/(b + d)), s == (a + c)/(a + b + c + d), z == (b/(a + b))}, {s, c, d}]

Just in case it matters, I'll mention that a, b, c, and d all have to be positive integers. However, I haven't told Mathematica that.

$\endgroup$
1
  • 2
    $\begingroup$ FWIW, if you manually eliminate s with {s -> (a + c)/(a + b + c + d)} it finishes quickly. $\endgroup$
    – Michael E2
    Commented Nov 28, 2016 at 11:44

1 Answer 1

3
$\begingroup$

This simplifies to

Solve[{q == (H (1 - H)/(a + c)) ((F (s - 1) s)/(F s - F - H s)^2)^2 + (F (1 - F)/(b + d)) (-(H (s - 1) s)/(F (s - 1) - H s)^2)^2, 
       H == (a/(a + c)), 
       F == (b/(b + d)), 
       s == (a + c)/(a + b + c + d)}, q, {s, c, d}]

(* q -> -((a b (-a - b + a F + b H))/(a + b)^4) *)

which is equal to your simple form:

FullSimplify[-((a b (-a - b + a F + b H))/(a + b)^4) == (b/(a + b))^4 ((1 - H)/a + (1 - F)/b) a^2/b^2]
(* True *)
$\endgroup$
2
  • $\begingroup$ Solve[<OP's system>, {q, z}, {s, c, d}] also works. (Of course the question seems to be why does Eliminate fail?) $\endgroup$
    – Michael E2
    Commented Nov 28, 2016 at 13:43
  • $\begingroup$ @MichaelE2 Similar to why FullSimplify result depends on the names of the variables (example in the documentation) $\endgroup$
    – Stitch
    Commented Nov 28, 2016 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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