basic mathematical question

eli34

New member
Joined
Jun 19, 2020
Messages
2
I have a quite basic mathematical question.
I am trying to find the maximum of I(q)=-q∙log2(q)-(1-q)∙log2(1-q).
I tried to solve d/dq I(q)=0 but got a wrong answer (the right one is q=0.5).
I am going to detail how I solved it, and I will be happy to understand what is wrong.
I attached a file.
 

Attachments

  • QQQ.pdf
    79.8 KB · Views: 6
I have a quite basic mathematical question.
I am trying to find the maximum of I(q)=-q∙log2(q)-(1-q)∙log2(1-q).
I tried to solve d/dq I(q)=0 but got a wrong answer (the right one is q=0.5).
I am going to detail how I solved it, and I will be happy to understand what is wrong.
I attached a file.
I think, you have a "sign" mistake in the first line.

I suggest convert all the ln2 to lne - prior to differentiation. Lne2 can be factored out - and the "arithmetic" of differentiation would be much simpler.
 
With all those negatives, the odds of making a sign error are high. Simplify your life.

[MATH]\text {Let } r = 1 - q \implies \dfrac{dr}{dq} = -1 \text { and } I(q) = - \dfrac{1}{ln(2)} * \{q * ln(q) + r * ln(r) \} \implies \\ I'(q) = - \dfrac{1}{ln(2)} * \left \{ 1 * ln(q) + q * \dfrac{1}{q} + \left ( 1 * ln(r) + r * \dfrac{1}{r} \right ) * \dfrac{dr}{dq} \right \} =\\ -\dfrac{1}{ln(2)} * \{ ln(q) + 1 + (ln(r) + 1)(-1)\} = - \dfrac{1}{ln(2)}* \{ln(q) - ln(r)\} = \dfrac{1}{ln(2)} * ln \left ( \dfrac{1 - q}{q} \right ).\\ \therefore I'(q) = 0 \iff ln \left ( \dfrac{1 - q}{q} \right ) = 0 \implies\\ \dfrac{1 - q}{q} = 1 \implies 1 - q = q \implies 2q = 1 \implies q = 0.5.[/MATH]There was a reason you were taught factoring, substitutions, etc.
 
Last edited:
Top