What is the coefficient of TERM_STRING
in the expansion of
(expr(["*", TERM1_COEF, "x"]) +
TERM2)^{EXPONENT}?
Rather than multiplying out
(expr(["*", TERM1_COEF, "x"]) +
TERM2)^{EXPONENT}, we can use
the binomial theorem to list all the coefficients.
Write out all the terms of the expansion. What are the
binomial coefficients
for each term? (Though we really just care about the
\pink{TERM_STRING} term)
\blue{?} \cdot
\pink{
(
expr(["*", TERM1_COEF, "x"])
)
^{ EXPONENT - TERM}
}
TERM2^{TERM}
+
The binomial theorem indicates that the coefficient to the k^{th} term
(k going from 0 to EXPONENT) is
\binom{EXPONENT}{k}.
[What does this mean?]
\binom{n}{k} is an expression which indicates a set
of n elements combined k at a time ("n choose k"). \binom{n}{k} = \dfrac{n!}{k!(n-k)!}
\blue{\binom{EXPONENT}{TERM}}
\pink{
(
expr(["*", TERM1_COEF, "x"])
)
^{ EXPONENT - TERM}
}
TERM2^{TERM}
+
[How would I do this with Pascal's Triangle?]
You can use the
EXPONENT + 1^{th} row (one more than the
exponent) of Pascal's triangle to find the binomial
coefficients:
These values can replace the combinatorial terms in the equation above.
Expand:
\blue{choose(EXPONENT, TERM)} \cdot
\pink{
(
expr(["*", TERM1_COEF, "x"])
)
^{ EXPONENT - TERM}
}
TERM2^{TERM}
+
Simplify:
\qquad
\pink{
pow(TERM1_COEF, EXPONENT - TERM)
* choose(EXPONENT, TERM) *
pow(TERM2, TERM)
x^{EXPONENT - TERM}
x
}
+
The coefficient of
\pink{TERM_STRING} is
\pink{SOLUTION}.