# Genetic Algorithm

Find the value of $x$ that maximizes $\sin^{4}(x)$, $0 \leq x \leq \pi$ to an accuracy of at least one part in a million. Use a population size of fifty and a mutation rate of $1/(\text{twice the length of string})$.
So randomly select a population of 50 binary string of length 8. Decode them into base 10. Look at their fitness levels (e.g. $\sin^{4}(x)$). Now exclude $25$ of the strings with the lowest fitness levels. Use crossover between random pairs of strings to get 25 "child strings." Now use a mutation rate of $1/16$ on this new population of strings? Because you dont want a population of strings with end digit 0. This will cause domination.
The maximum value of $\sin x$ is $1$. So the maximum value of $\sin^{4} x$ is $1$. So maybe use a string length of $3$? Because $111 = 7$ in base 10.