# Maximizing the following function

I need to find values of $k_1$, $k_2$ and $k_3$ that maximize $C^{m_1}_{mm_1} \cdot C^{m_2}_{k_1-mm_1} \cdot C^{n_1}_{nn_1} \cdot C^{n_2}_{k_2-nn_1} \cdot C^{p_1}_{pp_1} \cdot C^{p_2}_{k_3-pp_1}$ where $k_1 + k_2 + k_3 = \text{Constant}$ and the other terms are constant as well.

I have figured out that the answer should respectively be

$$k_1 = \frac{m_1+m_2}{m_1 + m_2 + n_1 + n_2 + p_1 + p_2}$$ and $$k_2 = \frac{n_1+n_2}{m_1 + m_2 + n_1 + n_2 + p_1 + p_2}$$ and $$k_3 = \frac{p_1+p_2}{m_1 + m_2 + n_1 + n_2 + p_1 + p_2}$$

and have experimentally verified it as well for numerous input combinations.

I want to know what technique I can use to theoretically prove it. I tried taking partial derivatives with respect to $k_1$ and $k_2$ and setting them equal to 0 since $k_3$ is not a variable given the other 2. However, that did not give me the intended answer. Is that the way I should do it or is there some other method given the constraint of $k_1 + k_2 + k_3 = \text{Constant}$?

Thanks a lot for your help.