<s>[INST] maximum of combinatorial function Find the maximum of $\binom{30-k}{x} {(\frac{4}{5})}^{30-k}$ w.r.t. $k$, and find $k$ as a function of $x$ when the function maximises.
Note that as $k$ increases $\binom{30-k}{x}$ decreases and ${(\frac{4}{5})}^{30-k}$ increases.
 [/INST] When $k=30-x$, the binomial coefficient equals $1$, and the power of $\frac45$ is simply $\left(\frac45\right)^x$. Each time we decrease $k$ by $1$, the binomial coefficient increases by the ratio $\frac{\binom{n+1}{x}}{\binom{n}{x}}$ for some $n$, while the power of $\frac45$ decreases by a ratio of $\frac45$. Thus, we need to find the value of $n$ where $\frac{\binom{n+1}{x}}{\binom{n}{x}}<\frac54$ for the first time. That ratio simplifies to $\frac{n+1}{n+1-x}$. So, we calculate:
$$\begin{align}\frac{n+1}{n+1-x} &= \frac{5}{4}\\
4(n+1) &= 5(n+1-x)\\
4n + 4 &= 5n + 5 - 5x \\
5x - 1 &= n
\end{align}$$
It appears that the expression increases until $30-k=n=5x-1$, takes on the same value at $30-k=n+1=5x$, and then decreases from there. These correspond to the $k$ values $31-5x$ and $30-5x$. If $x=6$, the function is maximized at $k=0$ and $k=1$, for $x>6$, the maximum is only at $k=0$.
</s>