How do to find the values of p and q so that we get the maximum entropy if I have this equation?
\[X = -p*\log_2 (p)-q \log_2{q} - (1-p-q) \log_2 (1-p-q)\]
that's the expression for the first order base 2 entropy
well, i know a derivative is useful to find min/max points
With respect to what variable though?
p and q, unless otherwise noted, assume multivariate \[X = -p*\log_2 (p)-q \log_2{q} - (1-p-q) \log_2 (1-p-q)\] \[X_p = -2\log_2 (p)+2\log_2 (1-p-q)\] hard to see thru the logs
so I take partial derivative for p then for q and equate them to 0?
and then solve for q and p with the two equations.. Can I do that?
yes, essentially; and there is a formula to determine if its a saddle point as well; but its essentially the partials set to zero
how would I know that I didn't get a minimum?
i also recall that the gradF points to the highest point ...
if the second partials are signed; they follow the same rule for single variable stuff
Ah okay this is not a calculus course lol so I just know the basics.. if I get a positive value for both p and q then it's the highest point?
F(x,y), gradient F is the vector <Fx,Fy> when the gradient is equal to zero, we are either at a min/max or a saddle point
i believe the test is: D = FxxFyy - (Fxy)^2 but i forget the "rules" for distinguishing the Ds
Oh okay but to solve for p and q would I do Fx =0 then Fy=0
\[X_p = \log_2 (1-p-q)-\log_2 (p)\] i think i had a spurious little 2 in there at first Xp = 0 when (1-p-q)/p = 1 right?
yes
Xp = 0 when (1-p-q)/p = 1 ; how did you get this?
ahh sorry for the questions I'm jsut trying to find the max value of that equation
partial with respect to p; and the fact that ln(a)-ln(b) = ln(a/b)
and since ln(1) = 0, then a/b = 1
it looks like you end up with 2 equations in 2 unknowns .... if i see it right
i know if i try to latex this im gonna get a snap page just about the end of it :/
sorry I tried it but why doesn't the partial of p for (-(1-p-q)*log2(1-p-q) ) give you zero?
\[X = -p\frac{\ln(p)}{\ln2}-q \frac{\ln{q}}{\ln2} - (1-p-q) \frac{\ln (1-p-q)}{\ln2}\] \[X_p = -\frac{\ln(p)}{\ln2}-\frac{1}{\ln2} + \frac{\ln (1-p-q)}{\ln2}+\frac{1}{\ln2}\] \[X_p = \frac{1}{\ln2}\left( \ln (1-p-q)-\ln(p)\right)\] \[X_p = \frac{1}{\ln2} \ln (\frac{1-p-q}{p})=0\] when equal to ln(1)
Xq has a similar setup
Ohhhhhhhhh I see where I went wrong
1-p-q = p 1= 2p + q q = 1-2p 1-p-q = q 1 = p + 2q 1 = p + 2(1-2p) 1 = p + 2 - 4p 1 = 2 - 3p -1 = - 3p 1/3 = p ------------------- 1-1/3 - q = 1/3 2/3 - 1/3 = q = 1/3
whoa thanks so much for your help!!! I need to freshen up on my calculus and derivatives
good luck :)
Join our real-time social learning platform and learn together with your friends!