If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Computer science theory

### Course: Computer science theory>Unit 3

Lesson 2: Modern information theory

# Information entropy

Finally we arrive at our quantitative measure of entropy. Created by Brit Cruise.

## Want to join the conversation?

• can't get how machine 1 gives more information than machine 2 just because data coming out of it is more uncertain. How uncertainty is related to information. What exactly do we mean by information here. To me information is "what is conveyed or represented by a particular arrangement or sequence of things" are we talking about this information here.

Also I would like to tell what more information to me means. for that first thing I have to choose is for what I need information. For example I choose that I need information about "Computers" and then two machines gave me information as below:
Machine 1: computer is an electronic device.
Machine 2: computer is an electronic device which can perform huge arithmetic operations in fraction of seconds.
In the above i would say machine 2 is more informative as it gives more detailed information about the subject I wanted to know. How is this related to uncertainty. Is the second sentence produced by machine 2 is more uncertain than machine 1.

Is this entropy being used in some real world application, if yes then if you could have quoted a real world example in the video it would have been more clear. Why should I know What is entropy? Where it will help me? or where it helps the world to know about entropy
• AHHH! I think I have an answer, but it would be great if the community could verify. The whole question about 'which machine produces more information' could also be rephrased as 'which machine produces letters with less certainty'. The expression 'information' to me here is chosen a little counter intuitively. I see information as something that 'illuminates' a problem. This video on the other hand identified information as the total amount of variables, choices and outcomes the machine produces and which we have to work through to arrive at the right sequence of letters. Seeing as MACHINE 1 requires us to do MORE word by asking MORE questions it produces more 'information'. 'Information' here is not something 'informative' but rather something we need to wade through to get to the right answer.
• When Brit says #bounces = log(2)(#outcomes), what exactly does that mean? I didn't quite understand that.
• Consider the reverse of the equation, that is
2^#bounces = #outcomes

What Brit is referring to is the tree of bouncing coins that he drew.

After the first bounce, we arrive at 2 equally likely outcomes (either to the right or to the left). After the second bounce, we have 4 equally likely positions that the coin can land (4 equally likely outcomes). In general, after k bounces, we have 2^k equally likely positions that we can land on, thus the equation I wrote above.

1/p = #outcomes because the probability of each outcome is 1 over the number of outcomes (since each outcome is equally likely in the fair bouncing machine)
• At , how could there be 1.75 questions?
• This is because we took a weighted sum and got a sum of 1.75.

We got our weighted sum by taking the sum of the products of the probability of something happening (the weight) by the number of bounces it takes for that to happen (the data).
The probability of getting A is 0.5 and it takes 1 bounce to get to A. 0.5*1=0.5
The probability of getting B is 0.125 and it takes 3 bounces to get to B. 0.125*3=0.375
The probability of getting C is 0.125 and it takes 3 bounces to get to C. 0.125*3=0.375
The probability of getting D is 0.25 and it takes 2 bounces to get to D. 0.25*2=0.5
Now we take the average of those products: 0.5+0.375+0.375+0.5=1.75

I hope this helps!
• According to the rules of logarithms:sum(i=1,n) p_i * -1 log2(p), which means entropy is negative (for n odd)? That's weird . . . .
• Entropy is 0 or positive
Here's why:
Since p i s a probability we can say: 0 <= p <= 1
If p =1 then log_2(p) = 0 and -0 is just 0 (not negative)

For 0 < p < 1
log_2 of a value >0 and < 1 is negative
thus log_2(p) is a negative value
thus -p * log_2(p) is a positive value (a negative value times a negative is positive)

As a side note -p * log_2(p) = p * log_2 (1/p) if that form seems more intuitive

Hope this makes sense
• Why is this considered a measure of information, rather than of information efficiency? Is calling it the first just a different way of saying it's the second? The reason I ask this is that Nick Corrado's answer to the top comment seems to imply it's more like a measure of efficiency, if deleting unnecessary letters means it has more information.
• Efficiency always depends on the use case. If you delete all unnecessary characters it might contain the same amount of information so be more efficient in information/page but less efficient for a means of communication because it's harder to read.

Since entropy isn't about the kind or representation of information it's not helpful to think of it as efficiency. Since that would require you to have a use case in mind.
• http://en.wikipedia.org/wiki/Digital_Signature_Algorithm#Sensitivity
The above link describes the DSA algorithm.

Here, it says that "the entropy, secrecy, and uniqueness of the random signature k is critical." I understand how, given a signature, leaking k would allow someone to solve for the private key, x, but how does the entropy (the number of questions needed to find k, correct?) have to do with hiding x?
• Your looking for a high entropy in order to stop someone from randomly guessing what k (or any other value) might be. Encryption of this sort can be broken using brute force hacking (randomly guessing at the answer a lot of times) and the encryption is only as strong as its weakest link. Encryption of this type can always be brute forced if a powerful enough computer is given enough time so a high entropy is needed to increase the time it would take a computer to guess the correct code. This not only increases the security of the given algorithm but also acts as a deterrent (if the answer would take a typical computer 1000 years to guess hopefully that will deter 1000 people from trying for a year)

if your interested check out this video
about 18 min in theres an interesting bit on semi-prime numbers that applies
cheers
• What is the yellow, Z- shaped symbol at called? I want to look it up so I can learn more about it.