it probably will be obvious for most of you guys,but just in case.... for part a), after we take the drivitive we get something like:
$ 4*q^3*(1-q)^6-6*(1-q)^5*q^4=0 $
you may try to solve it this way: divide both side by q^3 and (1-q)^5, thus we get:
$ 4*(1-q)-6*q=0 $
then we can easily find q=6/10
for part two we can divide both side with:
$ (1-q)^{k-1}*q^{n-k-1} $ then we get:
$ q=(n-k)/n $
Correction: What you did was find the pr[T] which was 6/10. So the pr[H] = 1 - pr[T] = 4/10. You assumed k was #of Tails and got the pr[T]. So the answer is 1 - (n-k)/n = k/n. Jonathan Morales