# probability and statistics

I really need help with this question.

The coefficients $a,b,c$ of the quadratic equation $ax^2+bx+c=0$ are determined by throwing 3dice and reading off the value shown on the uppermost face of each die, so that the first die gives $a$, the second $b$ and and third $c$. Find the probabilities that the roots the equations are real, complex and equal.

I was thinking about using the fundamental formula but i'm not sure how to go about doing it. Help would be greatly appreciated.

-
Couldn't you just compute the discriminant and figure out when this is non-negative? If there are only finitely many options for the coefficients, then you should be able to just count... –  Thomas Mar 14 '12 at 15:04
The value of the discriminant $b^2-4ac$ tells you which of the three cases, with regards to the roots, you are in. For instance, there are complex roots if and only if $b^2-4ac<0$. Now find the probability that the square of the second roll is less than four times the product of the first and last rolls (or just find the number of outcomes in which that happens and multiply by $(1/6^3$). I would do two of the cases and the third would be 1 minus the sum of the probabilities of the other two. –  David Mitra Mar 14 '12 at 15:09
Not absolutely sure from the wording, but probably the case "real" is meant to include the case "real and equal," so the three events are not mutually exclusive. Probably "real" and "complex" are meant to be complementary, though technically the complex numbers include the reals, so probability of complex is $1$. However, by "complex" the person probably means "complex non-real." –  André Nicolas Mar 14 '12 at 15:45
@DavidMitra But the real roots also includes the equal roots. So the event are not mutually exclusive, hence we cant have 1 minus sum of the probabilities of the other two. Answer from Patrick Da Silva show that. –  Learner Mar 14 '12 at 15:46
@Learner Sorry. Three cases: real and distinct, real and repeated, complex (and non-real). –  David Mitra Mar 14 '12 at 15:47
show 3 more comments

The formula for the roots is $$x = \frac{ -b \pm\sqrt{b^2 - 4ac}}{2a}.$$ The real/complex dependence of the roots of the coefficients therefore only depends on $b^2 - 4ac$. Now since $1 \le a,b,c \le g$ and that those are integers, there are not many possibilities for this to equal zero. By inspection,

• $1 - 4ac \ge 0$ means $\frac 14 \ge ac$, which is impossible, hence we have $36$ complex-root-cases

• $4 - 4ac \ge 0$ means $1 \ge ac$, which means $a=c=1$, hence $(1,2,1)$ is one equal-root-case (and real), or the other $35$ cases are complex

• $9 - 4ac \ge 0$ means $\frac 94 \ge ac$, so that equality is impossible, but we can have $ac = 1$ and $ac=2$ to satisfy this inequality, hence there are three real-roots-cases here ($(1,3,1)$, $(1,3,2)$, $(2,3,1)$) and $33$ other complex-roots-cases

• $16- 4ac \ge 0$ means $ac \le 4$, hence $(4,4,1)$, $(2,4,2)$ and $(1,2,4)$ are 3 equal-root-cases, the number of ways to get $ac \le 4$ (if you count them, you get 11, 12, 13, 14, 21, 22, 31, 41, so there are $8$) is the number of real-root-cases, and the rest ($28$ cases) are complex

• $25- 4ac \ge 0$ means $\frac {25}4 \ge ac$, thus equality is impossible, but the number of ways to get $ac \le 6$ is $14$ (11,12,13,14,15,16, 21, 22, 23, 31, 32, 41, 51, 61 are the $14$ cases) hence the $22$ other cases are complex-roots-cases and those $14$ are real-root-cases

• $36- 4ac \ge 0$ means $ac \le 9$, hence $(3,6,3)$ is one equal-root-case and the real root cases are those with $ac \le 9$, hence giving the $15$ cases as for $ac \le 6$, plus the 3 cases 24, 33 and 42, for a total of $16$ real root-cases and $20$ complex-root-cases. To sum it up,

$b=1$ : 0 equal, 0 real, 36 complex $b=2$ : 1 equal, 1 real, 35 complex $b=3$ : 0 equal, 3 real, 33 complex $b=4$ : 3 equal, 8 real, 28 complex $b=5$ : 0 equal, 14 real, 22 complex $b=6$ : 0 equal, 16 real, 20 complex.

Therefore the probability that the roots are equal is $\frac{5}{6^3} = \frac 5{216}$, the probability that the roots are real is $\frac{1+3+8+14+16}{6^3} = \frac{42}{216}$ and the probability that the roots are complex is $\frac{36+35+33+28+22+20}{6^3} = \frac{174}{216}$.

Hope that helps,

-
A typo: I think you have "real" and "complex" interchanged in the last sentence. –  David Mitra Mar 14 '12 at 16:09
@David Mitra : Yes, definitely a typo. Thanks –  Patrick Da Silva Mar 15 '12 at 22:44

The value of the discriminant $b^2−4ac$ tells you which of the three cases, with regards to the roots, you are in. I'm assuming your three cases are: complex non-real roots, real distinct roots, and a real repeated root.

For instance, there are distinct real roots if and only if $b^2−4ac>0$. So, to find the probability that the roots are distinct and real, first find the number of outcomes in which the square of the second roll exceeds 4 times the product of the first and last rolls.

Let's do this. Assuming the dies are all six-sided, computing the number of such outcomes will be easy if you consider the value of the second roll:

If the second roll is 1 or 2 this can't happen (keep in mind we want $b^2>4ac$).

If the second roll is 3, there are exactly three outcomes: first roll 1, third 1 ($9>4\cdot1\cdot1$); first roll 2, third 1 ($9>4\cdot2\cdot1$); and first roll 1, third 2 ($9>4\cdot1\cdot2$).

I'll leave the rest for you...

The point is you can, with a bit of effort, find the number of outcomes for which the roots will be distinct and real. You just need to enumerate them so that you find them all.

Now, if the number of outcomes where the roots are distinct and real is $m$, then the probability that the roots are distinct and real is $m\cdot(1/6^3)$.

That's one case. Now do easy case (with regards to counting outcomes): the probability that the roots are the same is the probability that the square of the second roll is equal to four times the product of the other two rolls (the roots are equal if and only if $b^2=4ac$). Find the number of outcomes for which this happens and multiply by $1/6^3$.

The last case you can compute more easily. Just sum the two previous probabilities and subtract from 1 (one of the three cases has to happen and the three cases are mutually exclusive).

-
The probability $p$ that the roots are real would include two of my cases above (equal and real+distinct). You could take the sum of their probabilities to find $p$; or, you could compute $p$ directly. Note that the probability that the roots are complex and non-real would be $1-p$. You would still need to compute the probability that the roots are equal. –  David Mitra Mar 14 '12 at 16:00

For roots to be real,

$b^2 - 4ac >= 0$

the following values of {b,a,c} are possible,
{2,1,1}
{3,1,1} {3,1,2} {3,2,1}
{4,1,1} {4,1,2} {4,2,1} {4,2,2} {4,3,1} {4,13,}
{5,1,1} {5,1,2} {5,2,1} {5,2,2} {5,3,2} {5,2,3} {5,3,1} {5,1,3}
{6,1,1} {6,1,2} {6,2,1} {6,2,2} {6,3,1} {6,1,3} {6,3,3} {6,3,2} {6,2,3}

These are 27 cases.

While the total cases possible for the values of a, b, c are 6*6*6 hence probability equals $\frac{27}{216}$ = $0.125$

..........................................................................................................................................
For the roots to be complex, 60 - 27 = 33 cases are possible, probability equals $\frac{3}{216}$ = $0.152$

..........................................................................................................................................

For roots to be equal, discriminant
$b^2 - 4ac = 0$

which is possible for the following values of {b,a,c} only {6,3,3}, {4,2,2}, {2,1,1}, probability equals
$\frac{3}{216}$ = $0.0138$

-

Or using a computer (in this case haskell):

\$ ghci
GHCi, version 7.0.3: http://www.haskell.org/ghc/  :? for help
Prelude> let cases = [b^2-4*a*c | a <- [1..6], b <-[1..6], c <-[1..6]]
Prelude> sum [ 1 | x <- cases]
216
Prelude> sum [ 1 | x <- cases, x > 0]
38
Prelude> sum [ 1 | x <- cases, x == 0]
5
Prelude> sum [ 1 | x <- cases, x < 0]
173
Prelude> :q
Leaving GHCi.

-