I posted a question earlier, but I couldn't speak English, so the explanation was lacking. sorry. (so I'm asking a question again using a translator.)

Anyway, I would like to ask a question about the problem of tossing a coin, which is classified as calculus.

.

.

Problem : If a coin with "probability of coming up heads" p is tossed n1 times, it comes up heads m1 times.
Also, when a coin with "probability of coming up heads" q is tossed n2 times, it comes up heads m2 times.
In this case, find the probability that p < q.

ex ) n1 = 2, m1 = 1, n2 = 4, m2 = 3 : Ans = 5/7

ex2 ) n1 = 8, m1 = 4, n2 = 16, m2 = 8 : Ans = 1/2

ex3 ) n1 = 2, m1 = 0, n2 = 6, m2 = 1 : Ans = 8/15

ex4 ) n1 = 2, m1 = 0, n2 = 2, m2 = 1 : Ans = 4/5

.

.

[The equation I established](https://i.stack.imgur.com/QHT7Q.png)

The equation I established was as follows, but when I substituted n1 = 2, m1 = 0, n2 = 2, m2 = 1, I could see that the equation was wrong because 11/70 came out. (Since the answer needs to be 4/5...) (+ Now that I look at it, I wrote the relationship between p and q in reverse.)

Please help me with how to set up the equation, or solve this problem.

Thank you.