PHYS Statistical Mechanics I Assignment 4 Solutions
|
|
- Harriet Underwood
- 5 years ago
- Views:
Transcription
1 PHYS Statistical Mechanics I Assignment 4 Solutions 1. The Shannon entropy is S = d p i log 2 p i. The Boltzmann entropy is the same, other than a prefactor of k B and the base of the log is e. Neither of those things are important for this proof, so let s work with the Shannon entropy for convenience. We maximize the entropy by asking that S/ p i = 0. The problem is that we don t know how to take derivatives of logs, only of lns. So first, write this in terms of the ln, in which case it is almost identical to the Boltzmann entropy: S = 1 ln(2) d p i lnp i. If d = 2, then Maximizing the entropy gives S 2 = 1 ln(2) [plnp+(1 p)ln(1 p)]. 1 [lnp+1 ln(1 p) 1] = 0 ln(p) = ln(1 p), ln(2) which has the solution p = 1 2, as expected. For a d-dimensional coin, the probabilities are p 1,p 2,...,p d where p d = 1 p 1 p 2... p = 1 p i. So the entropy is [ ( S = 1 p 1 lnp 1 +p 2 lnp ln(2) ) ( )] p i ln 1 p i. Now, we need to maximize the entropy for each of the p s, but all of them have exactly the same equation, that is [ ( ] ( ) 1 lnp j +1 ln 1 p i ) 1 = 0 ln(p j ) = ln 1 p i ln(2) ( 1 ) ln p i = 0. p j This means that each p j = 1 p i, that is the difference between 1 and the sum of all the others. But this means that each p j is identical, or p j = 1 ()p j, which is equivalent to dp j = 1 or p j = 1/d.
2 PHYS Assignment 4 Solutions 2 2. This is done in C, and the results are attached at the end. I ll summarize the results here. (a) First off, looking at the actual data one finds that there are exactly zero pixels with the bit value 0. Is this white or black? Given that the number of pixels with value 255 is large, and the picture is fairly dark, I would guess that bit value 0 is actually white, not black. Anyhow, it doesn t change the analysis. Calculating the various probabilities of obtaining the bit values, one can calculate the Shannon entropy. I obtain S 7.463, so that the image needs on average bits per pixel to represent the data. Given that there are pixels in the image, this suggests that I could compress the image to a minimum size of bits or bytes (there are 8 bits in byte) which is 13 Mb. Considering that the original file is 14 Mb, this is not much of a savings given lossless compression. (b) Interestingly, gzip compressed the figure to only bytes, so this algorithm uses something fancier than straight Huffman coding. Likely it is making use of improved encodings where (for example) contiguous strings of the same bit value are reduced to two integers (the bit value and the number of instances). Windows zip produced a file that was slightly larger at bytes. A straight conversion of the tif gives a gif that is bytes, a jpeg that is bytes, and a png that is bytes. Given that both gzip and zip are lossless, and close to optimal, we can infer that both gif and png are lossless image formats, but that jpeg is lossy. A quick scan of the literature confirms this. (c) The mean bit length for the data using the Huffman coding was found to be approximately 7.506, which is larger than the Shannon entropy (thank goodness, otherwise it would be wrong!) but very close. The encoding that I found uses a maximum of 17 bits and is 99.43% efficient. Not bad! (d) The variance of the bit length about the mean was found to be approximately 1.398, which gives a standard deviation of only 1.182, which is only just larger than a single bit. Because the variance is the difference between the mean of the square and the square of the mean, we can subtract the square of the mean to obtain b 2 = ( b) 2 + b 2 = so that the RMS value is approximately bits. This is, unsurprisingly, very close to the mean bitlength because the variance is so comparably tiny. 3. (a) {0,10,11 This cannot be a Huffman encoding for any probabilities. If the smallest probability is assigned bitstring 0, then necessarily the other two probabilities must connect to the tree on the final branch labeled 1, so that the last bit for both must be 1. (b) {00,01,10,110 This also can t be a Huffman encoding. With four variables, the only two possible trees are perfectly balanced (i.e. all probabilities are close) or totally unbalanced (like for the tree produced with probabilities 1/2, 1/4, 1/8 and 1/8. The first gives an encoding like {00,01,10,11 while the second gives something like {0, 01, 011, 111. (c) {01,10. This one is fine. It doesn t violate any rules. It is simply stupid because it employs two bits when you could get away with using only one.
3 // This code performs a binary Huffman encoding #include <stdio.h> #include <stdlib.h> #include <math.h> #define elements 256 FILE *fin; main() { int i,j,c,nc; int symbol[elements]; double prob,entropy,total; char filename[50]; // parameters for the Huffman encoding algorithm int which1,which2,tree,max_bits; int bits[elements],branch[elements]; unsigned long bin[elements][elements]; double min,min1,min2,mean_bits,variance; double problist[elements]; // first read in the data from a text file (formatted input) fin=fopen("histogram.txt","r"); if (fin == NULL) { printf("unable to open file\n"); exit(1); for (i=0;i<elements;i++) fscanf(fin,"%d\t%d\n",&j,&(symbol[i])); fclose(fin); // print out to check it's read in properly // for (i=0;i<elements;i++) printf("%d %d\n",i,symbol[i]); // calculate the probabilities and the Shannon entropy nc=0; for (i=0;i<elements;i++) nc += symbol[i]; printf("total number of pixels = %d\n",nc); entropy=0.0; total=0.0; prob=(double)(symbol[i])/(double)nc; problist[i]=prob; // printf("%d %lf\n",i,prob); if (prob > 0.0) entropy -= prob*log(prob)/log(2.0); total += prob; printf("total probability = %lf\n",total); printf("minimum entropy = %lf\n",entropy); // Next determine the encoding that approximates this max_bits=0; for (j=0;j<elements;j++) bin[i][j]=0; bits[i]=0; branch[i]=i; tree=elements-1; for (;;) { min=2.0;
4 if (problist[i] <= min) { min=problist[i]; which1=i; min1=min; min=2.0; if (problist[i] <= min && problist[i] > min1) { min=problist[i]; which2=i; min2=min; // printf("%d: %lf, %d: %lf\n",which1+1,min1,which2+1,min2); ++tree; if (branch[i] == branch[which2]) { bin[i][bits[i]] += 1; if (branch[i] == branch[which1] branch[i] == branch[which2]) { branch[i]=tree; problist[i]=min1+min2; /* printf("element %d: branch %d, %d bits, probability %lf,",i+1, branch[i],bits[i]+1,problist[i]); printf("binary = "); for (j=elements-1;j>=0;j--) printf("%d",bin[i][j]); printf("\n"); */ ++(bits[i]); if (bits[i] > max_bits) max_bits = bits[i]; if (fabs(problist[which1]-1.0) < 0.01) break; // now parse the results mean_bits=0.0; printf("maximum number of bits used = %d\n",max_bits); prob=(double)(symbol[i])/(double)nc; printf("greyscale value %2d: bits = %2d, val = ",i,bits[i]); for (j=max_bits-1;j>=0;j--) printf("%d",bin[i][j]); printf(", prob = %lf\n",prob); mean_bits += prob*bits[i]; printf("mean bitlength = %lf\n",mean_bits); printf("efficiency = %lf\%\n",entropy/mean_bits); variance=0.0; prob=(double)(symbol[i])/(double)nc; variance += prob*(bits[i]-mean_bits)*(bits[i]-mean_bits); // printf("%d %lf\n",i+1,prob*(bits[i]-mean_bits)*(bits[i]-mean_bits)); printf("variance = %lf\n",variance);
5 total number of pixels = total probability = minimum entropy = maximum number of bits used = 17 greyscale value 0: bits = 17, val = , prob = greyscale value 1: bits = 17, val = , prob = greyscale value 2: bits = 16, val = , prob = greyscale value 3: bits = 15, val = , prob = greyscale value 4: bits = 14, val = , prob = greyscale value 5: bits = 13, val = , prob = greyscale value 6: bits = 12, val = , prob = greyscale value 7: bits = 11, val = , prob = greyscale value 8: bits = 10, val = , prob = greyscale value 9: bits = 9, val = , prob = greyscale value 10: bits = 8, val = , prob = greyscale value 11: bits = 8, val = , prob = greyscale value 12: bits = 8, val = , prob = greyscale value 13: bits = 7, val = , prob = greyscale value 14: bits = 7, val = , prob = greyscale value 15: bits = 7, val = , prob = greyscale value 16: bits = 7, val = , prob = greyscale value 17: bits = 7, val = , prob = greyscale value 18: bits = 7, val = , prob = greyscale value 19: bits = 7, val = , prob = greyscale value 20: bits = 7, val = , prob = greyscale value 21: bits = 7, val = , prob = greyscale value 22: bits = 7, val = , prob = greyscale value 23: bits = 7, val = , prob = greyscale value 24: bits = 7, val = , prob = greyscale value 25: bits = 7, val = , prob = greyscale value 26: bits = 7, val = , prob = greyscale value 27: bits = 7, val = , prob = greyscale value 28: bits = 7, val = , prob = greyscale value 29: bits = 8, val = , prob = greyscale value 30: bits = 8, val = , prob = greyscale value 31: bits = 8, val = , prob = greyscale value 32: bits = 8, val = , prob = greyscale value 33: bits = 8, val = , prob = greyscale value 34: bits = 8, val = , prob = greyscale value 35: bits = 8, val = , prob = greyscale value 36: bits = 8, val = , prob = greyscale value 37: bits = 8, val = , prob = greyscale value 38: bits = 8, val = , prob = greyscale value 39: bits = 8, val = , prob = greyscale value 40: bits = 8, val = , prob = greyscale value 41: bits = 8, val = , prob = greyscale value 42: bits = 8, val = , prob = greyscale value 43: bits = 8, val = , prob = greyscale value 44: bits = 8, val = , prob = greyscale value 45: bits = 8, val = , prob = greyscale value 46: bits = 8, val = , prob = greyscale value 47: bits = 7, val = , prob = greyscale value 48: bits = 7, val = , prob = greyscale value 49: bits = 7, val = , prob = greyscale value 50: bits = 7, val = , prob = greyscale value 51: bits = 7, val = , prob = greyscale value 52: bits = 8, val = , prob = greyscale value 53: bits = 8, val = , prob = greyscale value 54: bits = 8, val = , prob = greyscale value 55: bits = 8, val = , prob = greyscale value 56: bits = 8, val = , prob = greyscale value 57: bits = 8, val = , prob = greyscale value 58: bits = 8, val = , prob = greyscale value 59: bits = 8, val = , prob = greyscale value 60: bits = 8, val = , prob = greyscale value 61: bits = 8, val = , prob =
6 greyscale value 62: bits = 8, val = , prob = greyscale value 63: bits = 8, val = , prob = greyscale value 64: bits = 8, val = , prob = greyscale value 65: bits = 8, val = , prob = greyscale value 66: bits = 8, val = , prob = greyscale value 67: bits = 8, val = , prob = greyscale value 68: bits = 8, val = , prob = greyscale value 69: bits = 8, val = , prob = greyscale value 70: bits = 8, val = , prob = greyscale value 71: bits = 8, val = , prob = greyscale value 72: bits = 8, val = , prob = greyscale value 73: bits = 8, val = , prob = greyscale value 74: bits = 8, val = , prob = greyscale value 75: bits = 8, val = , prob = greyscale value 76: bits = 8, val = , prob = greyscale value 77: bits = 8, val = , prob = greyscale value 78: bits = 8, val = , prob = greyscale value 79: bits = 8, val = , prob = greyscale value 80: bits = 8, val = , prob = greyscale value 81: bits = 8, val = , prob = greyscale value 82: bits = 8, val = , prob = greyscale value 83: bits = 8, val = , prob = greyscale value 84: bits = 8, val = , prob = greyscale value 85: bits = 9, val = , prob = greyscale value 86: bits = 9, val = , prob = greyscale value 87: bits = 9, val = , prob = greyscale value 88: bits = 9, val = , prob = greyscale value 89: bits = 9, val = , prob = greyscale value 90: bits = 9, val = , prob = greyscale value 91: bits = 9, val = , prob = greyscale value 92: bits = 9, val = , prob = greyscale value 93: bits = 9, val = , prob = greyscale value 94: bits = 9, val = , prob = greyscale value 95: bits = 9, val = , prob = greyscale value 96: bits = 9, val = , prob = greyscale value 97: bits = 9, val = , prob = greyscale value 98: bits = 9, val = , prob = greyscale value 99: bits = 9, val = , prob = greyscale value 100: bits = 9, val = , prob = greyscale value 101: bits = 9, val = , prob = greyscale value 102: bits = 9, val = , prob = greyscale value 103: bits = 9, val = , prob = greyscale value 104: bits = 9, val = , prob = greyscale value 105: bits = 9, val = , prob = greyscale value 106: bits = 9, val = , prob = greyscale value 107: bits = 9, val = , prob = greyscale value 108: bits = 9, val = , prob = greyscale value 109: bits = 9, val = , prob = greyscale value 110: bits = 9, val = , prob = greyscale value 111: bits = 10, val = , prob = greyscale value 112: bits = 10, val = , prob = greyscale value 113: bits = 10, val = , prob = greyscale value 114: bits = 9, val = , prob = greyscale value 115: bits = 9, val = , prob = greyscale value 116: bits = 9, val = , prob = greyscale value 117: bits = 9, val = , prob = greyscale value 118: bits = 8, val = , prob = greyscale value 119: bits = 7, val = , prob = greyscale value 120: bits = 7, val = , prob = greyscale value 121: bits = 7, val = , prob = greyscale value 122: bits = 7, val = , prob = greyscale value 123: bits = 6, val = , prob = greyscale value 124: bits = 6, val = , prob = greyscale value 125: bits = 6, val = , prob = greyscale value 126: bits = 6, val = , prob = greyscale value 127: bits = 6, val = , prob =
7 greyscale value 128: bits = 6, val = , prob = greyscale value 129: bits = 6, val = , prob = greyscale value 130: bits = 6, val = , prob = greyscale value 131: bits = 6, val = , prob = greyscale value 132: bits = 6, val = , prob = greyscale value 133: bits = 6, val = , prob = greyscale value 134: bits = 6, val = , prob = greyscale value 135: bits = 6, val = , prob = greyscale value 136: bits = 6, val = , prob = greyscale value 137: bits = 6, val = , prob = greyscale value 138: bits = 6, val = , prob = greyscale value 139: bits = 6, val = , prob = greyscale value 140: bits = 7, val = , prob = greyscale value 141: bits = 7, val = , prob = greyscale value 142: bits = 7, val = , prob = greyscale value 143: bits = 7, val = , prob = greyscale value 144: bits = 7, val = , prob = greyscale value 145: bits = 7, val = , prob = greyscale value 146: bits = 7, val = , prob = greyscale value 147: bits = 7, val = , prob = greyscale value 148: bits = 7, val = , prob = greyscale value 149: bits = 7, val = , prob = greyscale value 150: bits = 7, val = , prob = greyscale value 151: bits = 7, val = , prob = greyscale value 152: bits = 7, val = , prob = greyscale value 153: bits = 7, val = , prob = greyscale value 154: bits = 7, val = , prob = greyscale value 155: bits = 7, val = , prob = greyscale value 156: bits = 8, val = , prob = greyscale value 157: bits = 8, val = , prob = greyscale value 158: bits = 8, val = , prob = greyscale value 159: bits = 8, val = , prob = greyscale value 160: bits = 8, val = , prob = greyscale value 161: bits = 8, val = , prob = greyscale value 162: bits = 8, val = , prob = greyscale value 163: bits = 8, val = , prob = greyscale value 164: bits = 8, val = , prob = greyscale value 165: bits = 8, val = , prob = greyscale value 166: bits = 8, val = , prob = greyscale value 167: bits = 8, val = , prob = greyscale value 168: bits = 9, val = , prob = greyscale value 169: bits = 9, val = , prob = greyscale value 170: bits = 9, val = , prob = greyscale value 171: bits = 9, val = , prob = greyscale value 172: bits = 9, val = , prob = greyscale value 173: bits = 9, val = , prob = greyscale value 174: bits = 9, val = , prob = greyscale value 175: bits = 9, val = , prob = greyscale value 176: bits = 9, val = , prob = greyscale value 177: bits = 9, val = , prob = greyscale value 178: bits = 9, val = , prob = greyscale value 179: bits = 9, val = , prob = greyscale value 180: bits = 9, val = , prob = greyscale value 181: bits = 10, val = , prob = greyscale value 182: bits = 9, val = , prob = greyscale value 183: bits = 9, val = , prob = greyscale value 184: bits = 9, val = , prob = greyscale value 185: bits = 9, val = , prob = greyscale value 186: bits = 9, val = , prob = greyscale value 187: bits = 9, val = , prob = greyscale value 188: bits = 10, val = , prob = greyscale value 189: bits = 10, val = , prob = greyscale value 190: bits = 10, val = , prob = greyscale value 191: bits = 11, val = , prob = greyscale value 192: bits = 11, val = , prob = greyscale value 193: bits = 11, val = , prob =
8 greyscale value 194: bits = 11, val = , prob = greyscale value 195: bits = 11, val = , prob = greyscale value 196: bits = 11, val = , prob = greyscale value 197: bits = 11, val = , prob = greyscale value 198: bits = 11, val = , prob = greyscale value 199: bits = 11, val = , prob = greyscale value 200: bits = 11, val = , prob = greyscale value 201: bits = 11, val = , prob = greyscale value 202: bits = 11, val = , prob = greyscale value 203: bits = 11, val = , prob = greyscale value 204: bits = 11, val = , prob = greyscale value 205: bits = 11, val = , prob = greyscale value 206: bits = 11, val = , prob = greyscale value 207: bits = 11, val = , prob = greyscale value 208: bits = 11, val = , prob = greyscale value 209: bits = 11, val = , prob = greyscale value 210: bits = 11, val = , prob = greyscale value 211: bits = 11, val = , prob = greyscale value 212: bits = 11, val = , prob = greyscale value 213: bits = 11, val = , prob = greyscale value 214: bits = 11, val = , prob = greyscale value 215: bits = 11, val = , prob = greyscale value 216: bits = 11, val = , prob = greyscale value 217: bits = 11, val = , prob = greyscale value 218: bits = 11, val = , prob = greyscale value 219: bits = 10, val = , prob = greyscale value 220: bits = 10, val = , prob = greyscale value 221: bits = 10, val = , prob = greyscale value 222: bits = 10, val = , prob = greyscale value 223: bits = 10, val = , prob = greyscale value 224: bits = 10, val = , prob = greyscale value 225: bits = 10, val = , prob = greyscale value 226: bits = 10, val = , prob = greyscale value 227: bits = 10, val = , prob = greyscale value 228: bits = 10, val = , prob = greyscale value 229: bits = 11, val = , prob = greyscale value 230: bits = 11, val = , prob = greyscale value 231: bits = 11, val = , prob = greyscale value 232: bits = 11, val = , prob = greyscale value 233: bits = 11, val = , prob = greyscale value 234: bits = 10, val = , prob = greyscale value 235: bits = 10, val = , prob = greyscale value 236: bits = 10, val = , prob = greyscale value 237: bits = 11, val = , prob = greyscale value 238: bits = 11, val = , prob = greyscale value 239: bits = 11, val = , prob = greyscale value 240: bits = 11, val = , prob = greyscale value 241: bits = 11, val = , prob = greyscale value 242: bits = 11, val = , prob = greyscale value 243: bits = 11, val = , prob = greyscale value 244: bits = 11, val = , prob = greyscale value 245: bits = 11, val = , prob = greyscale value 246: bits = 11, val = , prob = greyscale value 247: bits = 11, val = , prob = greyscale value 248: bits = 11, val = , prob = greyscale value 249: bits = 11, val = , prob = greyscale value 250: bits = 11, val = , prob = greyscale value 251: bits = 11, val = , prob = greyscale value 252: bits = 11, val = , prob = greyscale value 253: bits = 11, val = , prob = greyscale value 254: bits = 10, val = , prob = greyscale value 255: bits = 7, val = , prob = mean bitlength = efficiency = variance =
Information and Entropy. Professor Kevin Gold
Information and Entropy Professor Kevin Gold What s Information? Informally, when I communicate a message to you, that s information. Your grade is 100/100 Information can be encoded as a signal. Words
More informationSource Coding. Master Universitario en Ingeniería de Telecomunicación. I. Santamaría Universidad de Cantabria
Source Coding Master Universitario en Ingeniería de Telecomunicación I. Santamaría Universidad de Cantabria Contents Introduction Asymptotic Equipartition Property Optimal Codes (Huffman Coding) Universal
More informationCS4800: Algorithms & Data Jonathan Ullman
CS4800: Algorithms & Data Jonathan Ullman Lecture 22: Greedy Algorithms: Huffman Codes Data Compression and Entropy Apr 5, 2018 Data Compression How do we store strings of text compactly? A (binary) code
More informationLecture 1: Shannon s Theorem
Lecture 1: Shannon s Theorem Lecturer: Travis Gagie January 13th, 2015 Welcome to Data Compression! I m Travis and I ll be your instructor this week. If you haven t registered yet, don t worry, we ll work
More informationCSE 421 Greedy: Huffman Codes
CSE 421 Greedy: Huffman Codes Yin Tat Lee 1 Compression Example 100k file, 6 letter alphabet: File Size: ASCII, 8 bits/char: 800kbits 2 3 > 6; 3 bits/char: 300kbits better: 2.52 bits/char 74%*2 +26%*4:
More informationRun-length & Entropy Coding. Redundancy Removal. Sampling. Quantization. Perform inverse operations at the receiver EEE
General e Image Coder Structure Motion Video x(s 1,s 2,t) or x(s 1,s 2 ) Natural Image Sampling A form of data compression; usually lossless, but can be lossy Redundancy Removal Lossless compression: predictive
More informationLecture 4 : Adaptive source coding algorithms
Lecture 4 : Adaptive source coding algorithms February 2, 28 Information Theory Outline 1. Motivation ; 2. adaptive Huffman encoding ; 3. Gallager and Knuth s method ; 4. Dictionary methods : Lempel-Ziv
More informationImage and Multidimensional Signal Processing
Image and Multidimensional Signal Processing Professor William Hoff Dept of Electrical Engineering &Computer Science http://inside.mines.edu/~whoff/ Image Compression 2 Image Compression Goal: Reduce amount
More information4. Quantization and Data Compression. ECE 302 Spring 2012 Purdue University, School of ECE Prof. Ilya Pollak
4. Quantization and Data Compression ECE 32 Spring 22 Purdue University, School of ECE Prof. What is data compression? Reducing the file size without compromising the quality of the data stored in the
More informationLecture 3 : Algorithms for source coding. September 30, 2016
Lecture 3 : Algorithms for source coding September 30, 2016 Outline 1. Huffman code ; proof of optimality ; 2. Coding with intervals : Shannon-Fano-Elias code and Shannon code ; 3. Arithmetic coding. 1/39
More informationAutumn Coping with NP-completeness (Conclusion) Introduction to Data Compression
Autumn Coping with NP-completeness (Conclusion) Introduction to Data Compression Kirkpatrick (984) Analogy from thermodynamics. The best crystals are found by annealing. First heat up the material to let
More informationChapter 2: Source coding
Chapter 2: meghdadi@ensil.unilim.fr University of Limoges Chapter 2: Entropy of Markov Source Chapter 2: Entropy of Markov Source Markov model for information sources Given the present, the future is independent
More informationSource Coding Techniques
Source Coding Techniques. Huffman Code. 2. Two-pass Huffman Code. 3. Lemple-Ziv Code. 4. Fano code. 5. Shannon Code. 6. Arithmetic Code. Source Coding Techniques. Huffman Code. 2. Two-path Huffman Code.
More informationLecture 10 : Basic Compression Algorithms
Lecture 10 : Basic Compression Algorithms Modeling and Compression We are interested in modeling multimedia data. To model means to replace something complex with a simpler (= shorter) analog. Some models
More informationBandwidth: Communicate large complex & highly detailed 3D models through lowbandwidth connection (e.g. VRML over the Internet)
Compression Motivation Bandwidth: Communicate large complex & highly detailed 3D models through lowbandwidth connection (e.g. VRML over the Internet) Storage: Store large & complex 3D models (e.g. 3D scanner
More informationImage Compression. Fundamentals: Coding redundancy. The gray level histogram of an image can reveal a great deal of information about the image
Fundamentals: Coding redundancy The gray level histogram of an image can reveal a great deal of information about the image That probability (frequency) of occurrence of gray level r k is p(r k ), p n
More information( c ) E p s t e i n, C a r t e r a n d B o l l i n g e r C h a p t e r 1 7 : I n f o r m a t i o n S c i e n c e P a g e 1
( c ) E p s t e i n, C a r t e r a n d B o l l i n g e r 2 0 1 6 C h a p t e r 1 7 : I n f o r m a t i o n S c i e n c e P a g e 1 CHAPTER 17: Information Science In this chapter, we learn how data can
More information17.1 Binary Codes Normal numbers we use are in base 10, which are called decimal numbers. Each digit can be 10 possible numbers: 0, 1, 2, 9.
( c ) E p s t e i n, C a r t e r, B o l l i n g e r, A u r i s p a C h a p t e r 17: I n f o r m a t i o n S c i e n c e P a g e 1 CHAPTER 17: Information Science 17.1 Binary Codes Normal numbers we use
More informationECE 587 / STA 563: Lecture 5 Lossless Compression
ECE 587 / STA 563: Lecture 5 Lossless Compression Information Theory Duke University, Fall 2017 Author: Galen Reeves Last Modified: October 18, 2017 Outline of lecture: 5.1 Introduction to Lossless Source
More information! Where are we on course map? ! What we did in lab last week. " How it relates to this week. ! Compression. " What is it, examples, classifications
Lecture #3 Compression! Where are we on course map?! What we did in lab last week " How it relates to this week! Compression " What is it, examples, classifications " Probability based compression # Huffman
More information1. Basics of Information
1. Basics of Information 6.004x Computation Structures Part 1 Digital Circuits Copyright 2015 MIT EECS 6.004 Computation Structures L1: Basics of Information, Slide #1 What is Information? Information,
More informationrepetition, part ii Ole-Johan Skrede INF Digital Image Processing
repetition, part ii Ole-Johan Skrede 24.05.2017 INF2310 - Digital Image Processing Department of Informatics The Faculty of Mathematics and Natural Sciences University of Oslo today s lecture Coding and
More informationTTIC 31230, Fundamentals of Deep Learning David McAllester, April Information Theory and Distribution Modeling
TTIC 31230, Fundamentals of Deep Learning David McAllester, April 2017 Information Theory and Distribution Modeling Why do we model distributions and conditional distributions using the following objective
More informationSequence comparison by compression
Sequence comparison by compression Motivation similarity as a marker for homology. And homology is used to infer function. Sometimes, we are only interested in a numerical distance between two sequences.
More informationInformation Theory. Coding and Information Theory. Information Theory Textbooks. Entropy
Coding and Information Theory Chris Williams, School of Informatics, University of Edinburgh Overview What is information theory? Entropy Coding Information Theory Shannon (1948): Information theory is
More informationInformation & Correlation
Information & Correlation Jilles Vreeken 11 June 2014 (TADA) Questions of the day What is information? How can we measure correlation? and what do talking drums have to do with this? Bits and Pieces What
More informationLecture 1 : Data Compression and Entropy
CPS290: Algorithmic Foundations of Data Science January 8, 207 Lecture : Data Compression and Entropy Lecturer: Kamesh Munagala Scribe: Kamesh Munagala In this lecture, we will study a simple model for
More informationAn introduction to basic information theory. Hampus Wessman
An introduction to basic information theory Hampus Wessman Abstract We give a short and simple introduction to basic information theory, by stripping away all the non-essentials. Theoretical bounds on
More informationECE 587 / STA 563: Lecture 5 Lossless Compression
ECE 587 / STA 563: Lecture 5 Lossless Compression Information Theory Duke University, Fall 28 Author: Galen Reeves Last Modified: September 27, 28 Outline of lecture: 5. Introduction to Lossless Source
More information1 Introduction to information theory
1 Introduction to information theory 1.1 Introduction In this chapter we present some of the basic concepts of information theory. The situations we have in mind involve the exchange of information through
More informationChapter 3 Source Coding. 3.1 An Introduction to Source Coding 3.2 Optimal Source Codes 3.3 Shannon-Fano Code 3.4 Huffman Code
Chapter 3 Source Coding 3. An Introduction to Source Coding 3.2 Optimal Source Codes 3.3 Shannon-Fano Code 3.4 Huffman Code 3. An Introduction to Source Coding Entropy (in bits per symbol) implies in average
More informationMultimedia. Multimedia Data Compression (Lossless Compression Algorithms)
Course Code 005636 (Fall 2017) Multimedia Multimedia Data Compression (Lossless Compression Algorithms) Prof. S. M. Riazul Islam, Dept. of Computer Engineering, Sejong University, Korea E-mail: riaz@sejong.ac.kr
More informationChapter 9 Fundamental Limits in Information Theory
Chapter 9 Fundamental Limits in Information Theory Information Theory is the fundamental theory behind information manipulation, including data compression and data transmission. 9.1 Introduction o For
More informationECE472/572 - Lecture 11. Roadmap. Roadmap. Image Compression Fundamentals and Lossless Compression Techniques 11/03/11.
ECE47/57 - Lecture Image Compression Fundamentals and Lossless Compression Techniques /03/ Roadmap Preprocessing low level Image Enhancement Image Restoration Image Segmentation Image Acquisition Image
More informationData Compression Techniques (Spring 2012) Model Solutions for Exercise 2
582487 Data Compression Techniques (Spring 22) Model Solutions for Exercise 2 If you have any feedback or corrections, please contact nvalimak at cs.helsinki.fi.. Problem: Construct a canonical prefix
More informationCompressing Kinetic Data From Sensor Networks. Sorelle A. Friedler (Swat 04) Joint work with David Mount University of Maryland, College Park
Compressing Kinetic Data From Sensor Networks Sorelle A. Friedler (Swat 04) Joint work with David Mount University of Maryland, College Park Motivation Motivation Computer Science Graphics: Image and video
More informationCSEP 521 Applied Algorithms Spring Statistical Lossless Data Compression
CSEP 52 Applied Algorithms Spring 25 Statistical Lossless Data Compression Outline for Tonight Basic Concepts in Data Compression Entropy Prefix codes Huffman Coding Arithmetic Coding Run Length Coding
More informationCMPT 365 Multimedia Systems. Lossless Compression
CMPT 365 Multimedia Systems Lossless Compression Spring 2017 Edited from slides by Dr. Jiangchuan Liu CMPT365 Multimedia Systems 1 Outline Why compression? Entropy Variable Length Coding Shannon-Fano Coding
More informationSIGNAL COMPRESSION Lecture 7. Variable to Fix Encoding
SIGNAL COMPRESSION Lecture 7 Variable to Fix Encoding 1. Tunstall codes 2. Petry codes 3. Generalized Tunstall codes for Markov sources (a presentation of the paper by I. Tabus, G. Korodi, J. Rissanen.
More informationMassachusetts Institute of Technology
Name (1%): Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Department of Mechanical Engineering 6.050J/2.110J Information and Entropy Spring 2006 Issued:
More informationImage Compression. Qiaoyong Zhong. November 19, CAS-MPG Partner Institute for Computational Biology (PICB)
Image Compression Qiaoyong Zhong CAS-MPG Partner Institute for Computational Biology (PICB) November 19, 2012 1 / 53 Image Compression The art and science of reducing the amount of data required to represent
More informationSIGNAL COMPRESSION Lecture Shannon-Fano-Elias Codes and Arithmetic Coding
SIGNAL COMPRESSION Lecture 3 4.9.2007 Shannon-Fano-Elias Codes and Arithmetic Coding 1 Shannon-Fano-Elias Coding We discuss how to encode the symbols {a 1, a 2,..., a m }, knowing their probabilities,
More informationBASICS OF COMPRESSION THEORY
BASICS OF COMPRESSION THEORY Why Compression? Task: storage and transport of multimedia information. E.g.: non-interlaced HDTV: 0x0x0x = Mb/s!! Solutions: Develop technologies for higher bandwidth Find
More informationLecture 11: Extrema. Nathan Pflueger. 2 October 2013
Lecture 11: Extrema Nathan Pflueger 2 October 201 1 Introduction In this lecture we begin to consider the notion of extrema of functions on chosen intervals. This discussion will continue in the lectures
More informationTuring Machines Part Three
Turing Machines Part Three What problems can we solve with a computer? What kind of computer? Very Important Terminology Let M be a Turing machine. M accepts a string w if it enters an accept state when
More informationMultimedia Communications. Mathematical Preliminaries for Lossless Compression
Multimedia Communications Mathematical Preliminaries for Lossless Compression What we will see in this chapter Definition of information and entropy Modeling a data source Definition of coding and when
More information2018/5/3. YU Xiangyu
2018/5/3 YU Xiangyu yuxy@scut.edu.cn Entropy Huffman Code Entropy of Discrete Source Definition of entropy: If an information source X can generate n different messages x 1, x 2,, x i,, x n, then the
More informationIntro to Information Theory
Intro to Information Theory Math Circle February 11, 2018 1. Random variables Let us review discrete random variables and some notation. A random variable X takes value a A with probability P (a) 0. Here
More informationWavelet Scalable Video Codec Part 1: image compression by JPEG2000
1 Wavelet Scalable Video Codec Part 1: image compression by JPEG2000 Aline Roumy aline.roumy@inria.fr May 2011 2 Motivation for Video Compression Digital video studio standard ITU-R Rec. 601 Y luminance
More informationLecture 3. Mathematical methods in communication I. REMINDER. A. Convex Set. A set R is a convex set iff, x 1,x 2 R, θ, 0 θ 1, θx 1 + θx 2 R, (1)
3- Mathematical methods in communication Lecture 3 Lecturer: Haim Permuter Scribe: Yuval Carmel, Dima Khaykin, Ziv Goldfeld I. REMINDER A. Convex Set A set R is a convex set iff, x,x 2 R, θ, θ, θx + θx
More informationMultimedia Information Systems
Multimedia Information Systems Samson Cheung EE 639, Fall 2004 Lecture 3 & 4: Color, Video, and Fundamentals of Data Compression 1 Color Science Light is an electromagnetic wave. Its color is characterized
More informationHomework Set #2 Data Compression, Huffman code and AEP
Homework Set #2 Data Compression, Huffman code and AEP 1. Huffman coding. Consider the random variable ( x1 x X = 2 x 3 x 4 x 5 x 6 x 7 0.50 0.26 0.11 0.04 0.04 0.03 0.02 (a Find a binary Huffman code
More informationCSE 408 Multimedia Information System Yezhou Yang
Image and Video Compression CSE 408 Multimedia Information System Yezhou Yang Lots of slides from Hassan Mansour Class plan Today: Project 2 roundup Today: Image and Video compression Nov 10: final project
More informationData Compression. Limit of Information Compression. October, Examples of codes 1
Data Compression Limit of Information Compression Radu Trîmbiţaş October, 202 Outline Contents Eamples of codes 2 Kraft Inequality 4 2. Kraft Inequality............................ 4 2.2 Kraft inequality
More informationOutline. Computer Science 418. Number of Keys in the Sum. More on Perfect Secrecy, One-Time Pad, Entropy. Mike Jacobson. Week 3
Outline Computer Science 48 More on Perfect Secrecy, One-Time Pad, Mike Jacobson Department of Computer Science University of Calgary Week 3 2 3 Mike Jacobson (University of Calgary) Computer Science 48
More informationEntropy-based data organization tricks for browsing logs and packet captures
Entropy-based data organization tricks for browsing logs and packet captures Department of Computer Science Dartmouth College Outline 1 Log browsing moves Pipes and tables Trees are better than pipes and
More informationWe are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors
CSC258 Week 3 1 Logistics If you cannot login to MarkUs, email me your UTORID and name. Check lab marks on MarkUs, if it s recorded wrong, contact Larry within a week after the lab. Quiz 1 average: 86%
More informationKotebe Metropolitan University Department of Computer Science and Technology Multimedia (CoSc 4151)
Kotebe Metropolitan University Department of Computer Science and Technology Multimedia (CoSc 4151) Chapter Three Multimedia Data Compression Part I: Entropy in ordinary words Claude Shannon developed
More informationData Structures in Java
Data Structures in Java Lecture 20: Algorithm Design Techniques 12/2/2015 Daniel Bauer 1 Algorithms and Problem Solving Purpose of algorithms: find solutions to problems. Data Structures provide ways of
More informationEntropy as a measure of surprise
Entropy as a measure of surprise Lecture 5: Sam Roweis September 26, 25 What does information do? It removes uncertainty. Information Conveyed = Uncertainty Removed = Surprise Yielded. How should we quantify
More informationDigital communication system. Shannon s separation principle
Digital communication system Representation of the source signal by a stream of (binary) symbols Adaptation to the properties of the transmission channel information source source coder channel coder modulation
More informationShannon-Fano-Elias coding
Shannon-Fano-Elias coding Suppose that we have a memoryless source X t taking values in the alphabet {1, 2,..., L}. Suppose that the probabilities for all symbols are strictly positive: p(i) > 0, i. The
More informationInformation and Entropy
Information and Entropy Shannon s Separation Principle Source Coding Principles Entropy Variable Length Codes Huffman Codes Joint Sources Arithmetic Codes Adaptive Codes Thomas Wiegand: Digital Image Communication
More informationSUPPLEMENTARY INFORMATION
SUPPLEMENTARY INFORMATION doi:10.1038/nature11875 Method for Encoding and Decoding Arbitrary Computer Files in DNA Fragments 1 Encoding 1.1: An arbitrary computer file is represented as a string S 0 of
More informationOptimal codes - I. A code is optimal if it has the shortest codeword length L. i i. This can be seen as an optimization problem. min.
Huffman coding Optimal codes - I A code is optimal if it has the shortest codeword length L L m = i= pl i i This can be seen as an optimization problem min i= li subject to D m m i= lp Gabriele Monfardini
More informationSTEP Support Programme. Hints and Partial Solutions for Assignment 17
STEP Support Programme Hints and Partial Solutions for Assignment 7 Warm-up You need to be quite careful with these proofs to ensure that you are not assuming something that should not be assumed. For
More informationRLE = [ ; ], with compression ratio (CR) = 4/8. RLE actually increases the size of the compressed image.
MP/BME 574 Application Solutions. (2 pts) a) From first principles in class, we expect the entropy of the checkerboard image to be since this is the bit depth of the image and the frequency of each value
More informationCoding for Discrete Source
EGR 544 Communication Theory 3. Coding for Discrete Sources Z. Aliyazicioglu Electrical and Computer Engineering Department Cal Poly Pomona Coding for Discrete Source Coding Represent source data effectively
More informationText Compression. Jayadev Misra The University of Texas at Austin December 5, A Very Incomplete Introduction to Information Theory 2
Text Compression Jayadev Misra The University of Texas at Austin December 5, 2003 Contents 1 Introduction 1 2 A Very Incomplete Introduction to Information Theory 2 3 Huffman Coding 5 3.1 Uniquely Decodable
More informationOptimisation and Operations Research
Optimisation and Operations Research Lecture 15: The Greedy Heuristic Matthew Roughan http://www.maths.adelaide.edu.au/matthew.roughan/ Lecture_notes/OORII/ School of
More informationData Compression Techniques
Data Compression Techniques Part 2: Text Compression Lecture 5: Context-Based Compression Juha Kärkkäinen 14.11.2017 1 / 19 Text Compression We will now look at techniques for text compression. These techniques
More informationIntroduction to information theory and coding
Introduction to information theory and coding Louis WEHENKEL Set of slides No 5 State of the art in data compression Stochastic processes and models for information sources First Shannon theorem : data
More informationCOMP9319 Web Data Compression and Search. Lecture 2: Adaptive Huffman, BWT
COMP9319 Web Data Compression and Search Lecture 2: daptive Huffman, BWT 1 Original readings Login to your cse account:! cd ~cs9319/papers! Original readings of each lecture will be placed there. 2 Course
More informationCompressing Tabular Data via Pairwise Dependencies
Compressing Tabular Data via Pairwise Dependencies Amir Ingber, Yahoo! Research TCE Conference, June 22, 2017 Joint work with Dmitri Pavlichin, Tsachy Weissman (Stanford) Huge datasets: everywhere - Internet
More informationKolmogorov complexity ; induction, prediction and compression
Kolmogorov complexity ; induction, prediction and compression Contents 1 Motivation for Kolmogorov complexity 1 2 Formal Definition 2 3 Trying to compute Kolmogorov complexity 3 4 Standard upper bounds
More informationCOMP 120. For any doubts in the following, contact Agam, Room. 023
COMP 120 Computer Organization Spring 2006 For any doubts in the following, contact Agam, Room. 023 Problem Set #1 Solution Problem 1. Miss Information [A] First card ca n be any one of 52 possibilities.
More informationInformation Theory. David Rosenberg. June 15, New York University. David Rosenberg (New York University) DS-GA 1003 June 15, / 18
Information Theory David Rosenberg New York University June 15, 2015 David Rosenberg (New York University) DS-GA 1003 June 15, 2015 1 / 18 A Measure of Information? Consider a discrete random variable
More informationNumber Representation and Waveform Quantization
1 Number Representation and Waveform Quantization 1 Introduction This lab presents two important concepts for working with digital signals. The first section discusses how numbers are stored in memory.
More informationCompression and Coding
Compression and Coding Theory and Applications Part 1: Fundamentals Gloria Menegaz 1 Transmitter (Encoder) What is the problem? Receiver (Decoder) Transformation information unit Channel Ordering (significance)
More informationData compression. Harald Nautsch ISY Informationskodning, Linköpings universitet.
Data compression Harald Nautsch harald.nautsch@liu.se ISY Informationskodning, Linköpings universitet http://www.icg.isy.liu.se/en/courses/tsbk08/ Course contents Source modeling: Random variables and
More informationEE376A: Homework #2 Solutions Due by 11:59pm Thursday, February 1st, 2018
Please submit the solutions on Gradescope. Some definitions that may be useful: EE376A: Homework #2 Solutions Due by 11:59pm Thursday, February 1st, 2018 Definition 1: A sequence of random variables X
More informationModule 2 LOSSLESS IMAGE COMPRESSION SYSTEMS. Version 2 ECE IIT, Kharagpur
Module 2 LOSSLESS IMAGE COMPRESSION SYSTEMS Lesson 5 Other Coding Techniques Instructional Objectives At the end of this lesson, the students should be able to:. Convert a gray-scale image into bit-plane
More informationMassachusetts Institute of Technology. Final Exam Solutions. Solution to Problem 1: Knowin the Nomenclature (9%)
Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Department of Mechanical Engineering 6.5J/2.11J Information and Entropy Spring 23 Final Exam Solutions Solution
More informationCompSci 267 Data Compression
CompSci 267 Data Compression Prerequisite: CompSci 161 or 260 or 261 Recommended textbook K. Sayood, Introduction to Data Compression, 3rd ed., Morgan Kaufmann, San Francisco, 2006. Requirements term project,
More informationDepartment of Electrical Engineering, Polytechnic University, Brooklyn Fall 05 EL DIGITAL IMAGE PROCESSING (I) Final Exam 1/5/06, 1PM-4PM
Department of Electrical Engineering, Polytechnic University, Brooklyn Fall 05 EL512 --- DIGITAL IMAGE PROCESSING (I) Y. Wang Final Exam 1/5/06, 1PM-4PM Your Name: ID Number: Closed book. One sheet of
More informationImage Compression - JPEG
Overview of JPEG CpSc 86: Multimedia Systems and Applications Image Compression - JPEG What is JPEG? "Joint Photographic Expert Group". Voted as international standard in 99. Works with colour and greyscale
More informationAssignment 3 with Solutions
Discrete Mathematics (Math 27), Spring 2004 Assignment 3 with Solutions. Recall the definition of functions, one-to-one functions, and onto functions. (a) Consider the function f : R R with f(x) x x. i.
More informationMassachusetts Institute of Technology
Name (%): Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Department of Mechanical Engineering 6.050J/2.0J Information and Entropy Spring 2005 Issued: May
More informationExpressions that always have the same value. The Identity Property of Addition states that For any value a; a + 0 = a so = 3
Name Key Words/Topic 2.1 Identity and Zero Properties Topic 2 Guided Notes Equivalent Expressions Identity Property of Addition Identity Property of Multiplication Zero Property of Multiplication The sum
More informationGetting Started with Communications Engineering
1 Linear algebra is the algebra of linear equations: the term linear being used in the same sense as in linear functions, such as: which is the equation of a straight line. y ax c (0.1) Of course, if we
More informationAdapting Boyer-Moore-Like Algorithms for Searching Huffman Encoded Texts
Adapting Boyer-Moore-Like Algorithms for Searching Huffman Encoded Texts Domenico Cantone Simone Faro Emanuele Giaquinta Department of Mathematics and Computer Science, University of Catania, Italy 1 /
More informationHuffman Coding. C.M. Liu Perceptual Lab, College of Computer Science National Chiao-Tung University
Huffman Coding C.M. Liu Perceptual Lab, College of Computer Science National Chiao-Tung University http://www.csie.nctu.edu.tw/~cmliu/courses/compression/ Office: EC538 (03)573877 cmliu@cs.nctu.edu.tw
More informationKolmogorov complexity: a primer. Alexander Shen, LIF CNRS & Univ. Aix Marseille. June 26, 2009
Kolmogorov complexity: a primer Alexander Shen, LIF CNRS & Univ. Aix Marseille June 26, 2009 Information density The same English text uses four times more space in UTF-32 compared to ASCII Information
More informationFeature selection. Micha Elsner. January 29, 2014
Feature selection Micha Elsner January 29, 2014 2 Using megam as max-ent learner Hal Daume III from UMD wrote a max-ent learner Pretty typical of many classifiers out there... Step one: create a text file
More informationEE376A: Homework #3 Due by 11:59pm Saturday, February 10th, 2018
Please submit the solutions on Gradescope. EE376A: Homework #3 Due by 11:59pm Saturday, February 10th, 2018 1. Optimal codeword lengths. Although the codeword lengths of an optimal variable length code
More information3F1 Information Theory, Lecture 3
3F1 Information Theory, Lecture 3 Jossy Sayir Department of Engineering Michaelmas 2011, 28 November 2011 Memoryless Sources Arithmetic Coding Sources with Memory 2 / 19 Summary of last lecture Prefix-free
More informationSometimes the domains X and Z will be the same, so this might be written:
II. MULTIVARIATE CALCULUS The first lecture covered functions where a single input goes in, and a single output comes out. Most economic applications aren t so simple. In most cases, a number of variables
More informationSolutions to Set #2 Data Compression, Huffman code and AEP
Solutions to Set #2 Data Compression, Huffman code and AEP. Huffman coding. Consider the random variable ( ) x x X = 2 x 3 x 4 x 5 x 6 x 7 0.50 0.26 0. 0.04 0.04 0.03 0.02 (a) Find a binary Huffman code
More informationChapter 2 Date Compression: Source Coding. 2.1 An Introduction to Source Coding 2.2 Optimal Source Codes 2.3 Huffman Code
Chapter 2 Date Compression: Source Coding 2.1 An Introduction to Source Coding 2.2 Optimal Source Codes 2.3 Huffman Code 2.1 An Introduction to Source Coding Source coding can be seen as an efficient way
More informationCompression. What. Why. Reduce the amount of information (bits) needed to represent image Video: 720 x 480 res, 30 fps, color
Compression What Reduce the amount of information (bits) needed to represent image Video: 720 x 480 res, 30 fps, color Why 720x480x20x3 = 31,104,000 bytes/sec 30x60x120 = 216 Gigabytes for a 2 hour movie
More information