Problem
I have a bag of many red and green balls. To find out the ratio between the two, I randomly picked balls with replacement. Out of the 100 outcomes, 60 were red balls and 40 were green balls. Say the red ball ratio is $x$, and the green ball ratio is $1-x$. I want to use the Maximum Likelihood Estimation to determine $x$.
I tried the following: The probability of picking a red ball is $x$. $$ X_b= \begin{cases} 60, & \text{if}\ b=R \\ 40, & \text{otherwise} \end{cases} $$ An estimator of maximum likelihood is given by $$L(X_i|x) = x^{X_i} (1-x)^{1-X_i}$$ If we pick a red ball from our sample, we will have $L(X_R|x) = x^{X_R} (1-x)^{1-X_R}$
\begin{align*} \frac{\partial}{\partial x} L(X_R|x) = 0 \implies \frac{\partial}{\partial x} \log L(X_R|x) &= \frac{X_R}{x} - \frac{1-X_R}{1-x} = 0 \end{align*}
Thus, $x = X_R = 60$
I don't know where I am mistaken. I believe that the ratio of red balls should be $x = 0.6$ and that of green balls should be $1-x = 0.4$. Because the probability of picking red ball is $P(X_R) = \frac{|R|}{|\Omega|} = \frac{60}{100} = 0.6$