 1  Handout #22 May 23, 2012 Huffman Encoding and Data Compression. CS106B Spring Handout by Julie Zelenski with minor edits by Keith Schwarz


 Emery Potter
 2 years ago
 Views:
Transcription
1 CS106B Spring 01 Handout # May 3, 01 Huffman Encoding and Data Compression Handout by Julie Zelenski wit minor edits by Keit Scwarz In te early 1980s, personal computers ad ard disks tat were no larger tan 10MB; today, te puniest of disks are still measured in undreds of gigabytes. Even toug ard drives are getting bigger, te files we want to store (funny pictures of cats, videos, music and so on) seem to keep pace wit tat growt wic makes even today's gargantuan disk seem too small to old everyting. One tecnique to use our storage more optimally is to compress te files. By taking advantage of redundancy or patterns, we may be able to "abbreviate" te contents in suc a way to take up less space yet maintain te ability to reconstruct a full version of te original wen needed. Suc compression could be useful wen trying to cram more tings on a disk or to sorten te time needed to copy/send a file over a network. Tere are compression algoritms tat you may already ave eard of. Some compression formats, suc as JPEG, MPEG, or MP3, are specifically designed to andle a particular type of data file. Tey tend to take advantage of known features of tat type of data (suc as te propensity for pixels in an image to be same or similar colors to teir neigbors) to compress it. Oter tools suc as compress, zip, or pack and programs like StuffIt or ZipIt can be used to compress any sort of file. Tese algoritms ave no a priori expectations and usually rely on studying te particular data file contents to find redundancy and patterns tat allow for compression. Some of te compression algoritms (e.g. JPEG, MPEG) are lossy decompressing te compressed result doesn't recreate a perfect copy of te original. Suc an algoritm compresses by "summarizing" te data. Te summary retains te general structure wile discarding te more minute details. For sound, video, and images, tis imprecision may be acceptable because te bulk of te data is maintained and a few missed pixels or milliseconds of video delay is no big deal. For text data, toug, a lossy algoritm usually isn't appropriate. An example of a lossy algoritm for compressing text would be to remove all te vowels. Compressing te previous sentence by tis sceme results in: n xmpl f lssy lgrtm fr cmprssng txt wld b t rmv ll t vwls. Tis srinks te original 87 caracters down to just 61 and requires only 70% of te original space. To decompress, we could try matcing te consonant patterns to Englis words wit vowels inserted, but we cannot reliably reconstruct te original in tis manner. Is te compressed word "fr" an abbreviation for te word "four" or te word "fir" or "far"? An intelligent reader can usually figure it out by context, but, alas, a brainless computer can't be sure and would not be able to faitfully reproduce te original. For files containing text, we usually want a lossless sceme so tat tere is no ambiguity wen recreating te original meaning and intent. An Overview Te standard ASCII caracter encoding uses te same amount of space (one byte or eigt bits, were eac bit is eiter a 0 or a 1) to store eac caracter. Common caracters don t get any special treatment; tey require te same 8 bits tat are used for muc rarer caracters suc as 'ü' or ' '. A file of 1000 caracters encoded using te ASCII sceme will take 1000 bytes (8000 bits); no more, no less, weter it be a file of 1000 spaces to a file containing instances eac of 50 different caracters. A fixedlengt encoding like ASCII is convenient because te boundaries between caracters are easily determined and te pattern used for eac caracter is completely fixed (i.e. 'a' is always exactly 97)
2 In practice, it is not te case tat all 56 caracters in te ASCII set occur wit equal frequency. In an Englis text document, it migt be te case tat only 90 or so distinct caracters are used at all (meaning 166 caracters in te ASCII never even appear) and witin tose 90 tere are likely to be significant differences in te caracter counts. Te Huffman encoding sceme takes advantage of te disparity between frequencies and uses less storage for te frequently occurring caracters at te expense of aving to use more storage for eac of te more rare caracters. Huffman is an example of a variablelengt encoding some caracters may only require or 3 bits and oter caracters may require 7, 10, or 1 bits. Te savings from not aving to use a full 8 bits for te most common caracters makes up for aving to use more tan 8 bits for te rare caracters and te overall effect is tat te file almost always requires less space. ASCII Encoding Te example we re going to use trougout tis andout is encoding te particular string "appy ip op" (don t ask me wat it means, I just made it up!). Using te standard ASCII encoding, tis 13 caracter string requires 13*8 = 10 bits total. Te table below sows te relevant subset of te standard ASCII table. car ASCII bit pattern (binary) a p y i o space Te string "appy ip op" would be encoded in ASCII as Altoug not easily readable by umans, it would be written as te following stream of bits (eac byte is boxed to sow te boundaries): To decode suc a string (i.e. translate te binary encoding back to te original caracters), we merely need to break te encoded stream of bits up into 8bit bytes, and ten convert eac byte using te fixed ASCII encoding. Te first 8 bits are , wic is te pattern for number 10, and position 10 in te ASCII set is assigned to lowercase ''. A file encoded in ASCII does not require any additional information to be decoded since te mapping from binary to caracters is te same for all files and computers. A more compact encoding Te first ting you migt notice about ASCII encoding is tat using 8 bits per caracter can be excessively generous. Altoug it allows for te possibility of representing 56 different caracters, we only ave seven distinct caracters in te prase we re trying to encode, and tus could distinguis among tese patterns wit fewer bits. We could set up a special coding table just for tis prase using 3 bits for eac caracter. Creating suc an encoding is trivial: we create a list of te unique caracters, and ten go troug and assign eac a distinct encoded number from 0 to N1. For example, ere is one possible 3bit encoding (of te 7! possible permutations):  
3 car number bit pattern a p 010 y i 100 o space Using tis table, "appy ip op" is encoded as , or in binary: Using tree bits per caracter, te encoded string requires 39 bits instead of te original 10 bits, compressing to 38% of its original size. However, to decode tis binary representation, one would need to know te special mapping used, since using 000 for '' is not standard practice and in fact, in tis sceme, eac compressed string uses its own specialpurpose mapping tat is not necessarily like any oter. Some sort of eader or auxiliary file would ave to be attaced or included wit te encoded representation tat provides te mapping information. Tat eader would take up some additional space tat would cut into our compression savings. For a large enoug file, toug, te savings from trimming down te percaracter cost would likely outweig te expense of te additional table storage. A variablelengt encoding Wat if we drop te requirement tat all caracters take up te same number of bits? By using fewer bits to encode caracters like 'p', '', and space tat occur frequently and more to encode caracters like 'y' and 'o' tat occur less frequently, we may be able to compress even furter. We ll later sow ow we generated te table below, but for now just take our word for it tat is represents an optimal Huffman encoding for te string "appy ip op": car bit pattern 01 a 000 p 10 y 1111 i 001 o 1110 space 110 Eac caracter as a unique bit pattern encoding, but not all caracters use te same number of bits. Te string "appy ip op" encoded using te above variablelengt code table is: Te encoded prase requires a total of 3 bits, saving a few more bits from te fixedlengt version. Wat is tricky about a variablelengt code is tat we no longer can easily determine te boundaries between caracters in te encoded stream of bits wen decoding. I boxed every oter caracter s bit pattern above to elp you visualize te encoding, but witout tis aid, you migt wonder ow you will know weter te first caracter is encoded wit te two bits 01 or te tree bits 010 or peraps just te first bit 0? If you look at te encoding in te table above, you will see tat only one of tese  3 
4 options is possible. Tere is no caracter tat encodes to te single bit 0 and no caracter tat encodes to te sequence 010 or 0100 or for tat matter. Tere is, owever, a caracter tat encodes to 01 and tat is ''. One of te important features of te table produced by Huffman coding is te prefix property: no caracter s encoding is a prefix of any oter (i.e. if '' is encoded wit 01 ten no oter caracter s encoding will start wit 01 and no caracter is encoded to just 0). Wit tis guarantee, tere is no ambiguity in determining were te caracter boundaries are. We start reading from te beginning, gatering bits in a sequence until we find a matc. Tat indicates te end of a caracter and we move on to decoding te next caracter. Like te specialpurpose fixedlengt encoding, a Huffman encoded file will need to provide a eader wit te information about te table used so we will be able to decode te file. Eac file s table will be unique since it is explicitly constructed to be optimal for tat file's contents. Encoding seen as a tree One way to visualize any particular encoding is to diagram it as a binary tree. Eac caracter is stored at a leaf node. Any particular caracter encoding is obtained by tracing te pat from te root to its node. Eac leftgoing edge represents a 0, eac rigtgoing edge a 1. For example, tis tree diagrams te compact fixedlengt encoding we developed previously: a p y i o a _ In te above tree, te encoding for 'y' can be determined by tracing te pat from te root to te 'y' node. Going left ten rigt ten rigt again represents a 011 encoding. A similar, muc larger tree could be constructed for te entire ASCII set, it would be 8 levels deep and at te bottom would be 56 leaf nodes, one for eac caracter. Te node for te caracter 'a' (97 or in binary) would be at te end of te leftrigtrigtleftleftleftleftrigt pat from te root. We're starting to see wy tey're called binary trees! Now, let s diagram suc a tree for te variablelengt Huffman encoding we were using:  
5 p a i _ 0 o 1 y Te pat to '' is just left rigt or 01, te pat to 'y' is rigtrigtrigtrigt or Notice tat te prefix property of te Huffman encoding is visually represented by te fact tat caracters only occupy leaf nodes (i.e. tose nodes wic are not a prefix of any furter nodes). Te tree sown above for "appy ip op" is, in fact, an optimal tree tere are no oter tree encodings by caracter tat use fewer tan 3 bits to encode tis string. Tere are oter trees tat use exactly 3 bits; for example you can simply swap any sibling nodes in te above tree and get a different but equally optimal encoding. Te Huffman tree doesn t appear as balanced as te fixedlengt encoding tree. You ve eard in our discussion on binary searc trees tat an unbalanced tree is bad ting. However, wen a tree represents a caracter encoding, tat lopsidedness is actually a good ting. Te sorter pats represent tose frequently occurring caracters tat are being encoded wit fewer bits and te longer pats are used for more rare caracters. Our plan is to srink te total number of bits required by sortening te encoding for some caracters at te expense of lengtening oters. If all caracters occurred wit equal frequency, we would ave a balanced tree were all pats were rougly equal. In suc a situation we can't acieve muc compression since tere are no real repetitions or patterns to be exploited. Decoding using te tree A particularly compelling reason to diagram an encoding as a tree is te ease wit wic it supports decoding. Let's use te fixedlengt tree to decode te stream of bits Start at te beginning of te bits and at te root of te tree. Te first bit is 0, so trace one step to te left, te next bit is 1, so follow rigt from tere, te following bit is 1, so take anoter rigt. We ave now landed at a leaf, wic indicates tat we ave just completed reading te bit pattern for a single caracter. Looking at te leaf's label, we learn we just read a 'y'. Now we pick up were we left off in te bits and start tracing again from te root. Tracing 101 leads us to 'i'. Continuing troug te remaining bits and we decode te string "yippy". Te same patfollowing strategy works equally well on te Huffman tree. Decoding te stream of bits will first trace four steps down to te left to it te 'y' leaf, ten a leftleftrigt pat to te 'i' leaf and so on. Again te decoded string is "yippy". Even toug te encoded caracters don't start and end at evenly spaced boundaries in te Huffmanencoded bits, we ave no trouble determining were eac caracter ends because we can easily detect wen te pat its a leaf node in te encoding tree
6 Generating an optimal tree Te pertinent question now: ow is tat special tree constructed? We need an algoritm for constructing te optimal tree giving a minimal percaracter encoding for a particular file. Te algoritm we will use ere was invented by D. Huffman in 195. To begin generating te Huffman tree, eac caracter gets a weigt equal to te number of times it occurs in te file. For example, in te "appy ip op" example, te caracter 'p' as weigt, '' as weigt 3, te space as weigt, and te oter caracters ave weigt 1. Our first task is to calculate tese weigts, wic we can do wit a simple pass troug te file to get te frequency counts. For eac caracter, we create an unattaced tree node containing te caracter value and its corresponding weigt. You can tink of eac node as a tree wit just one entry. Te idea is to combine all tese separate trees into an optimal tree by wiring tem togeter from te bottom upwards. Te general approac is as follows: 1. Create a collection of singleton trees, one for eac caracter, wit weigt equal to te caracter frequency.. From te collection, pick out te two trees wit te smallest weigts and remove tem. Combine tem into a new tree wose root as a weigt equal to te sum of te weigts of te two trees and wit te two trees as its left and rigt subtrees. 3. Add te new combined tree back into te collection.. Repeat steps and 3 until tere is only one tree left. 5. Te remaining node is te root of te optimal encoding tree. Sounds simple, doesn't it? Let's walk troug building te optimal tree for our example string "appy ip op". We start wit tis collection of singletons, te weigt of eac node is labeled underneat: p _ a i o y 3 We start by coosing te two smallest nodes. Tere are four nodes wit te minimal weigt of one, it doesn't matter wic two we pick. We coose 'o' and 'y' and combine tem into a new tree wose root is te sum of te weigts cosen. We replace tose two nodes wit te combined tree. Te nodes remaining in te collection are sown in te ligt gray box at eac stage. p _ a i 3 o y Now we repeat tat step, tis time tere is no coice for te minimal nodes, it must be 'a' and 'i'. We take tose out and combine tem into a weigt tree. Note ow te collection of nodes srinks by one eac iteration (we remove two nodes and add a new one back in)
7 p _ 3 o y a i Again, we pull out te two smallest nodes and build a tree of weigt : p 3 _ o y a i Note wen we build a combined node, it doesn t represent a caracter like te leaf nodes do. Tese interior nodes are used along te pats tat eventually lead to valid encodings, but te prefix itself does not encode a caracter. One more iteration combines te weigt 3 and trees into a combined tree of weigt 5: p 5 _ 3 a i o y Combining te two s gets a tree of weigt 8: 8 5 p 3 _ a i o y  7 
8 And finally, we combine te last two to get our final tree. Te root node of te final tree will always ave a weigt equal to te number of caracters in te input file p 3 _ a i o y Note tat tis tree is different from te tree on page, and as sligtly different bit patterns, but bot trees are optimal and te total number of bits required to encode "appy ip op" is te same for eiter tree. Wen we ave coices among equally weigted nodes (suc as in te first step coosing among te four caracters wit weigt 1) picking a different two will result in a different, but still optimal, encoding. Similarly wen combining two subtrees, it is as equally valid to put one of te trees on te left and te oter on te rigt as it is to reverse tem. Remember tat it is essential tat you use te same tree to do bot encoding and decoding of your files. Since eac Huffman tree creates a unique encoding of a particular file, you need to ensure tat your decoding algoritm generates te exact same tree, so tat you can get back te file. Practical Considerations: Te PseudoEOF Te preceding discussion of Huffman coding is correct from a teoretical perspective, but tere are a few realworld details we need to address before moving on. One important concern is wat appens wen we try to store a Huffmanencoded sequence ondisk in a file. Eac file on your computer is typically stored as a number of bytes (groups of eigt bits); files are usually measured in megabytes and gigabytes rater tan megabits or gigabits. As a result, if you try to write a Huffmanencoded string of bits into a file, if you don't ave exactly a multiple of eigt bits in your encoding, te operating system will typically pad te rest of te bits wit random bits. For example, suppose tat we want to encode te string aoy using te above Huffman tree. Tis results in te following sequence of bits: Tis is exactly tirteen bits, wic means tat, wen stored ondisk, te sequence would be padded wit tree extra random bits. Suppose tat tose bits are 111. In tat case, te bit sequence would be written to disk as If we were to ten load tis back from disk and decode it into a sequence of caracters, we would get  8 
9 te string aoyi, wic is not te same string tat we started wit! Even worse, if tose random bits end up being 000, ten te stored bit sequence would be Te problem is tat as we decode tis, we read te first tirteen bits back as aoy, but encounter an error wen reading te last tree bits because 000 is not a caracter in our encoding sceme. To fix tis problem, we ave to ave some way of knowing wen we've finised reading back all of te bits tat encode our sequence. One way of doing tis is to transform our original input string by putting some special marker at te end. Tis marker won't appear anywere else in te string and serves purely as an indicator tat tere is noting left to read. For example, we migt actually represent te string appy ip op as appy ip op, were marks te end of te input. Wen we build up our Huffman encoding tree for tis string, we will proceed exactly as before, but would add in an extra node for te marker. Here is one possible encoding tree for te caracters in tis new string: p 3 3 _ 1 a i o y Now, if we want to encode appy ip op, we get te following bitstring: Tis does not come out to a multiple of eigt bits (specifically, it's 39 bits long), wic means tat it will be padded wit extra bits wen stored ondisk. However, tis is of no concern to us because we ave written te marker to te end of te string, as we're decoding we can tell wen to stop reading bits. For example, ere is ow we migt decode te above string: 00 H 1100 A 10 P 10 P 1111 Y H 1101 I 10 P H 1110 O 10 P Extra bits ignored; we knew to stop wen seeing  9 
10 Tis caracter is called a pseudoendoffile caracter or pseudoeof caracter, since it marks were te logical end of te bitstream is, even if te file containing tat bitstream contains some extra garbage bits at te end. Wen you actually implement Huffman encoding in Assignment 6, you will ave to make sure to insert a pseudoeof caracter into your encoding tree and will ave to take appropriate steps to ensure tat you stop decoding bits wen you reac it. Practical Considerations: Te Encoding Table Tere is one last issue we ave not discussed yet. Suppose tat I want to compress a message and send it to you. Using Huffman coding, I can convert te message (plus te pseudoeof) into a string of bits and send it to you. However, you cannot decompress te message, because you don't ave te encoding tree tat I used to send te message. Tere are many ways to resolve tis. We could agree on an encoding tree in advance, but tis only works if we already know te distribution of te letters in advance. Tis migt be true if we were always compressing normal Englis text, but in general is not possible to do. A second option, and te option used in Assignment 6, is to prefix te bit sequence wit a eader containing enoug information to reconstruct te Huffman encoding tree. Tere are many options you ave for reading and writing te encoding table. You could store te table at te ead of te file in a long, umanreadable string format using te ASCII caracters '0' and '1', one caracter entry per eac line, like tis: = 01 a = 000 p = 10 y = Reading tis back in would allow you to recreate te tree pat by pat. You could ave a line for every caracter in te ASCII set; caracters tat are unused would ave an empty bit pattern. Or you could conserve space by only listing tose caracters tat appear in te encoding. In suc a case you must record a number tat tells ow many entries are in te table or put some sort of sentinel or marker at te end so you know wen you ave processed tem all. As an alternative to storing sequences of ASCII '0' and '1' caracters for te bit patterns, you could store just te caracter frequency counts and rebuild te tree again from tose counts in order to decompress. Again we migt include te counts for all caracters (including tose tat are zero) or optimize to only record tose tat are nonzero. Here is ow we migt encode te nonzero caracter counts for te "appy ip op" string (te 7 at te front says tere are 7 entries to follow 6 alpabetic caracters, and te space caracter): 6 3 a1 p y1 i1 o110 
11 Greedy algoritms Huffman's algoritm is an example of a greedy algoritm. In general, greedy algoritms use smallgrained, or local minimal/maximal coices in attempt to result in a global minimum/maximum. At eac step, te algoritm makes te near coice tat appears to lead toward te goal in te longterm. In Huffman's case, te insigt for its strategy is tat combining te two smallest nodes makes bot of tose caracter encodings one bit longer (because of te added parent node above tem) but given tese are te most rare caracters, it is a better coice to assign tem longer bit patterns tan te more frequent caracters. Te Huffman strategy does, in fact, lead to an overall optimal caracter encoding. Even wen a greedy strategy may not result in te overall best result, it still can be used to approximate wen te true optimal solution requires an exaustive or expensive traversal. In a time or spaceconstrained situation, we migt be willing to accept te quick and easytodetermine greedy solution as an approximation
M(0) = 1 M(1) = 2 M(h) = M(h 1) + M(h 2) + 1 (h > 1)
Insertion and Deletion in VL Trees Submitted in Partial Fulfillment of te Requirements for Dr. Eric Kaltofen s 66621: nalysis of lgoritms by Robert McCloskey December 14, 1984 1 ackground ccording to Knut
More informationDerivatives Math 120 Calculus I D Joyce, Fall 2013
Derivatives Mat 20 Calculus I D Joyce, Fall 203 Since we ave a good understanding of its, we can develop derivatives very quickly. Recall tat we defined te derivative f x of a function f at x to be te
More information7.6 Complex Fractions
Section 7.6 Comple Fractions 695 7.6 Comple Fractions In tis section we learn ow to simplify wat are called comple fractions, an eample of wic follows. 2 + 3 Note tat bot te numerator and denominator are
More informationTrapezoid Rule. y 2. y L
Trapezoid Rule and Simpson s Rule c 2002, 2008, 200 Donald Kreider and Dwigt Lar Trapezoid Rule Many applications of calculus involve definite integrals. If we can find an antiderivative for te integrand,
More informationGeometric Stratification of Accounting Data
Stratification of Accounting Data Patricia Gunning * Jane Mary Horgan ** William Yancey *** Abstract: We suggest a new procedure for defining te boundaries of te strata in igly skewed populations, usual
More informationUnderstanding the Derivative Backward and Forward by Dave Slomer
Understanding te Derivative Backward and Forward by Dave Slomer Slopes of lines are important, giving average rates of cange. Slopes of curves are even more important, giving instantaneous rates of cange.
More informationOptimal Pricing Strategy for Second Degree Price Discrimination
Optimal Pricing Strategy for Second Degree Price Discrimination Alex O Brien May 5, 2005 Abstract Second Degree price discrimination is a coupon strategy tat allows all consumers access to te coupon. Purcases
More informationGEOMETRY. Grades 6 8 Part 1 of 2. Lessons & Worksheets to Build Skills in Measuring Perimeter, Area, Surface Area, and Volume. Poster/Teaching Guide
Grades 6 8 Part 1 of 2 Poster/Teacing Guide GEOMETRY Lessons & Workseets to Build Skills in Measuring Perimeter, Area, Surface Area, and Volume Aligned wit NCTM Standards Mat Grants Available Lesson 1
More informationThis supplement is meant to be read after Venema s Section 9.2. Throughout this section, we assume all nine axioms of Euclidean geometry.
Mat 444/445 Geometry for Teacers Summer 2008 Supplement : Similar Triangles Tis supplement is meant to be read after Venema s Section 9.2. Trougout tis section, we assume all nine axioms of uclidean geometry.
More information2.0 5Minute Review: Polynomial Functions
mat 3 day 3: intro to limits 5Minute Review: Polynomial Functions You sould be familiar wit polynomials Tey are among te simplest of functions DEFINITION A polynomial is a function of te form y = p(x)
More informationACT Math Facts & Formulas
Numbers, Sequences, Factors Integers:..., 3, 2, 1, 0, 1, 2, 3,... Rationals: fractions, tat is, anyting expressable as a ratio of integers Reals: integers plus rationals plus special numbers suc as
More information2.28 EDGE Program. Introduction
Introduction Te Economic Diversification and Growt Enterprises Act became effective on 1 January 1995. Te creation of tis Act was to encourage new businesses to start or expand in Newfoundland and Labrador.
More information11.2 Instantaneous Rate of Change
11. Instantaneous Rate of Cange Question 1: How do you estimate te instantaneous rate of cange? Question : How do you compute te instantaneous rate of cange using a limit? Te average rate of cange is useful
More informationSolution Derivations for Capa #7
Solution Derivations for Capa #7 1) Consider te beavior of te circuit, wen various values increase or decrease. (Select Iincreases, Ddecreases, If te first is I and te rest D, enter IDDDD). A) If R1
More informationSAT Subject Math Level 1 Facts & Formulas
Numbers, Sequences, Factors Integers:..., 3, 2, 1, 0, 1, 2, 3,... Reals: integers plus fractions, decimals, and irrationals ( 2, 3, π, etc.) Order Of Operations: Aritmetic Sequences: PEMDAS (Parenteses
More informationLecture 10: What is a Function, definition, piecewise defined functions, difference quotient, domain of a function
Lecture 10: Wat is a Function, definition, piecewise defined functions, difference quotient, domain of a function A function arises wen one quantity depends on anoter. Many everyday relationsips between
More informationThe EOQ Inventory Formula
Te EOQ Inventory Formula James M. Cargal Matematics Department Troy University Montgomery Campus A basic problem for businesses and manufacturers is, wen ordering supplies, to determine wat quantity of
More informationInstantaneous Rate of Change:
Instantaneous Rate of Cange: Last section we discovered tat te average rate of cange in F(x) can also be interpreted as te slope of a scant line. Te average rate of cange involves te cange in F(x) over
More informationCollege Planning Using Cash Value Life Insurance
College Planning Using Cas Value Life Insurance CAUTION: Te advisor is urged to be extremely cautious of anoter college funding veicle wic provides a guaranteed return of premium immediately if funded
More informationNote nine: Linear programming CSE 101. 1 Linear constraints and objective functions. 1.1 Introductory example. Copyright c Sanjoy Dasgupta 1
Copyrigt c Sanjoy Dasgupta Figure. (a) Te feasible region for a linear program wit two variables (see tet for details). (b) Contour lines of te objective function: for different values of (profit). Te
More informationLet's Learn About Notes
2002 Product of Australia Contents Let's Learn About Notes by Beatrice Wilder Seet Seet 2 Seet 3 Seet 4 Seet 5 Seet 6 Seet 7 Seet 8 Seet 9 Seet 0 Seet Seet 2 Seet 3 Basic Information About Notes Lines
More informationFinite Difference Approximations
Capter Finite Difference Approximations Our goal is to approximate solutions to differential equations, i.e., to find a function (or some discrete approximation to tis function) tat satisfies a given relationsip
More informationME422 Mechanical Control Systems Modeling Fluid Systems
Cal Poly San Luis Obispo Mecanical Engineering ME422 Mecanical Control Systems Modeling Fluid Systems Owen/Ridgely, last update Mar 2003 Te dynamic euations for fluid flow are very similar to te dynamic
More informationCatalogue no. 12001XIE. Survey Methodology. December 2004
Catalogue no. 1001XIE Survey Metodology December 004 How to obtain more information Specific inquiries about tis product and related statistics or services sould be directed to: Business Survey Metods
More informationMath 113 HW #5 Solutions
Mat 3 HW #5 Solutions. Exercise.5.6. Suppose f is continuous on [, 5] and te only solutions of te equation f(x) = 6 are x = and x =. If f() = 8, explain wy f(3) > 6. Answer: Suppose we ad tat f(3) 6. Ten
More informationBinary Search Trees. Adnan Aziz. Heaps can perform extractmax, insert efficiently O(log n) worst case
Binary Searc Trees Adnan Aziz 1 BST basics Based on CLRS, C 12. Motivation: Heaps can perform extractmax, insert efficiently O(log n) worst case Has tables can perform insert, delete, lookup efficiently
More informationWriting Mathematics Papers
Writing Matematics Papers Tis essay is intended to elp your senior conference paper. It is a somewat astily produced amalgam of advice I ave given to students in my PDCs (Mat 4 and Mat 9), so it s not
More informationThe Derivative. Not for Sale
3 Te Te Derivative 3. Limits 3. Continuity 3.3 Rates of Cange 3. Definition of te Derivative 3.5 Grapical Differentiation Capter 3 Review Etended Application: A Model for Drugs Administered Intravenously
More informationVerifying Numerical Convergence Rates
1 Order of accuracy Verifying Numerical Convergence Rates We consider a numerical approximation of an exact value u. Te approximation depends on a small parameter, suc as te grid size or time step, and
More informationThe modelling of business rules for dashboard reporting using mutual information
8 t World IMACS / MODSIM Congress, Cairns, Australia 37 July 2009 ttp://mssanz.org.au/modsim09 Te modelling of business rules for dasboard reporting using mutual information Gregory Calbert Command, Control,
More informationTAKEHOME EXP. # 2 A Calculation of the Circumference and Radius of the Earth
TAKEHOME EXP. # 2 A Calculation of te Circumference and Radius of te Eart On two dates during te year, te geometric relationsip of Eart to te Sun produces "equinox", a word literally meaning, "equal nigt"
More informationComputer Science and Engineering, UCSD October 7, 1999 GoldreicLevin Teorem Autor: Bellare Te GoldreicLevin Teorem 1 Te problem We æx a an integer n for te lengt of te strings involved. If a is an nbit
More informationOptimized Data Indexing Algorithms for OLAP Systems
Database Systems Journal vol. I, no. 2/200 7 Optimized Data Indexing Algoritms for OLAP Systems Lucian BORNAZ Faculty of Cybernetics, Statistics and Economic Informatics Academy of Economic Studies, Bucarest
More informationPressure. Pressure. Atmospheric pressure. Conceptual example 1: Blood pressure. Pressure is force per unit area:
Pressure Pressure is force per unit area: F P = A Pressure Te direction of te force exerted on an object by a fluid is toward te object and perpendicular to its surface. At a microscopic level, te force
More informationRead This! Keys to Doing Your Best on the SAT
Capter 3 Read Tis! Keys to Doing Your Best on te SAT If you re like most testtakers, you see te SAT as an important exam, one tat can ave a big impact on your future. It s only natural, ten, tat you want
More informationA New Hybrid Metaheuristic Approach for Stratified Sampling
A New Hybrid Metaeuristic Approac for Stratified Sampling Timur KESKİNTÜRK 1, Sultan KUZU 2, Baadır F. YILDIRIM 3 1 Scool of Business, İstanbul University, İstanbul, Turkey 2 Scool of Business, İstanbul
More informationConservation of Energy 1 of 8
Conservation of Energy 1 of 8 Conservation of Energy Te important conclusions of tis capter are: If a system is isolated and tere is no friction (no nonconservative forces), ten KE + PE = constant (Our
More informationTangent Lines and Rates of Change
Tangent Lines and Rates of Cange 922005 Given a function y = f(x), ow do you find te slope of te tangent line to te grap at te point P(a, f(a))? (I m tinking of te tangent line as a line tat just skims
More informationModeling User Perception of Interaction Opportunities for Effective Teamwork
Modeling User Perception of Interaction Opportunities for Effective Teamwork Ece Kamar, Ya akov Gal and Barbara J. Grosz Scool of Engineering and Applied Sciences Harvard University, Cambridge, MA 02138
More informationInvestigating CostEfficient Ways of Running a Survey of Pacific Peoples. Undertaken for the Ministry of Pacific Island Affairs
Investigating CostEfficient Ways of Running a Survey of Pacific Peoples Undertaken for te Ministry of Pacific Island Affairs by Temaleti Tupou, assisted by Debra Taylor and Tracey Savage Survey Metods,
More informationA LowTemperature Creep Experiment Using Common Solder
A LowTemperature Creep Experiment Using Common Solder L. Roy Bunnell, Materials Science Teacer Soutridge Hig Scool Kennewick, WA 99338 roy.bunnell@ksd.org Copyrigt: Edmonds Community College 2009 Abstract:
More informationGuide to Cover Letters & Thank You Letters
Guide to Cover Letters & Tank You Letters 206 Strebel Student Center (315) 7923087 Fax (315) 7923370 TIPS FOR WRITING A PERFECT COVER LETTER Te resume never travels alone. Eac time you submit your resume
More informationDifferentiable Functions
Capter 8 Differentiable Functions A differentiable function is a function tat can be approximated locally by a linear function. 8.. Te derivative Definition 8.. Suppose tat f : (a, b) R and a < c < b.
More informationDiscovering Area Formulas of Quadrilaterals by Using Composite Figures
Activity: Format: Ojectives: Related 009 SOL(s): Materials: Time Required: Directions: Discovering Area Formulas of Quadrilaterals y Using Composite Figures Small group or Large Group Participants will
More informationWeek #15  Word Problems & Differential Equations Section 8.2
Week #1  Word Problems & Differential Equations Section 8. From Calculus, Single Variable by HugesHallett, Gleason, McCallum et. al. Copyrigt 00 by Jon Wiley & Sons, Inc. Tis material is used by permission
More informationA.4. Rational Expressions. Domain of an Algebraic Expression. What you should learn. Why you should learn it
A6 Appendi A Review of Fundamental Concepts of Algebra A.4 Rational Epressions Wat you sould learn Find domains of algebraic epressions. Simplify rational epressions. Add, subtract, multiply, and divide
More informationNew Vocabulary volume
. Plan Objectives To find te volume of a prism To find te volume of a cylinder Examples Finding Volume of a Rectangular Prism Finding Volume of a Triangular Prism 3 Finding Volume of a Cylinder Finding
More informationDistributed and Centralized Bypass Architectures Compared. E. Guidotti  AC Power Product Manager A. Ferro  Key Account Manager
Distributed and Centralized Bypass Arcitectures Compared E. Guidotti  AC Power Product Manager A. Ferro  Key Account Manager Contents Executive Summary 3 Distributed / Centralized  System description
More informationInformation, Entropy, and Coding
Chapter 8 Information, Entropy, and Coding 8. The Need for Data Compression To motivate the material in this chapter, we first consider various data sources and some estimates for the amount of data associated
More informationThe differential amplifier
DiffAmp.doc 1 Te differential amplifier Te emitter coupled differential amplifier output is V o = A d V d + A c V C Were V d = V 1 V 2 and V C = (V 1 + V 2 ) / 2 In te ideal differential amplifier A c
More informationAnalysis of Algorithms  Recurrences (cont.) 
Analysis of Algoritms  Recurrences (cont.)  Andreas Ermedal MRTC (Mälardalens Real Time Researc Center) andreas.ermedal@md.se Autumn 004 Recurrences: Reersal Recurrences appear frequently in running
More informationSWITCH T F T F SELECT. (b) local schedule of two branches. (a) ifthenelse construct A & B MUX. one iteration cycle
768 IEEE RANSACIONS ON COMPUERS, VOL. 46, NO. 7, JULY 997 Compileime Sceduling of Dynamic Constructs in Dataæow Program Graps Soonoi Ha, Member, IEEE and Edward A. Lee, Fellow, IEEE Abstract Sceduling
More informationACTIVITY: Deriving the Area Formula of a Trapezoid
4.3 Areas of Trapezoids a trapezoid? How can you derive a formula for te area of ACTIVITY: Deriving te Area Formula of a Trapezoid Work wit a partner. Use a piece of centimeter grid paper. a. Draw any
More informationDistances in random graphs with infinite mean degrees
Distances in random graps wit infinite mean degrees Henri van den Esker, Remco van der Hofstad, Gerard Hoogiemstra and Dmitri Znamenski April 26, 2005 Abstract We study random graps wit an i.i.d. degree
More informationA strong credit score can help you score a lower rate on a mortgage
NET GAIN Scoring points for your financial future AS SEEN IN USA TODAY S MONEY SECTION, JULY 3, 2007 A strong credit score can elp you score a lower rate on a mortgage By Sandra Block Sales of existing
More informationA system to monitor the quality of automated coding of textual answers to open questions
Researc in Official Statistics Number 2/2001 A system to monitor te quality of automated coding of textual answers to open questions Stefania Maccia * and Marcello D Orazio ** Italian National Statistical
More information1.6. Analyse Optimum Volume and Surface Area. Maximum Volume for a Given Surface Area. Example 1. Solution
1.6 Analyse Optimum Volume and Surface Area Estimation and oter informal metods of optimizing measures suc as surface area and volume often lead to reasonable solutions suc as te design of te tent in tis
More informationMath Test Sections. The College Board: Expanding College Opportunity
Taking te SAT I: Reasoning Test Mat Test Sections Te materials in tese files are intended for individual use by students getting ready to take an SAT Program test; permission for any oter use must be sougt
More informationAdvice for Undergraduates on Special Aspects of Writing Mathematics
Advice for Undergraduates on Special Aspects of Writing Matematics Abstract Tere are several guides to good matematical writing for professionals, but few for undergraduates. Yet undergraduates wo write
More information2.13 Solid Waste Management. Introduction. Scope and Objectives. Conclusions
Introduction Te planning and delivery of waste management in Newfoundland and Labrador is te direct responsibility of municipalities and communities. Te Province olds overall responsibility for te development
More informationFrom Raids to Deportation: Current Immigration Law Enforcement
W W a t i s g o i n g o n? From Raids to Deportation: Current Immigration Law Enforcement O u r c u r r e n t i m m i g r a t i o n l a w s a r e b r o k e n a n d n e e d t o b e f i x e d. T e r e c
More informationNAFN NEWS SPRING2011 ISSUE 7. Welcome to the Spring edition of the NAFN Newsletter! INDEX. Service Updates Follow That Car! Turn Back The Clock
NAFN NEWS ISSUE 7 SPRING2011 Welcome to te Spring edition of te NAFN Newsletter! Spring is in te air at NAFN as we see several new services cropping up. Driving and transport emerged as a natural teme
More informationModule 1: Introduction to Finite Element Analysis Lecture 1: Introduction
Module : Introduction to Finite Element Analysis Lecture : Introduction.. Introduction Te Finite Element Metod (FEM) is a numerical tecnique to find approximate solutions of partial differential equations.
More informationAverage and Instantaneous Rates of Change: The Derivative
9.3 verage and Instantaneous Rates of Cange: Te Derivative 609 OBJECTIVES 9.3 To define and find average rates of cange To define te derivative as a rate of cange To use te definition of derivative to
More informationHermite versus Simpson: the Geometry of Numerical Integration
Hermite versus Simpson: te Geometry of Numerical Integration Andy Long and Cliff Long October 9, 2010 Abstract An examination of current calculus and numerical analysis texts sows tat wen composite numerical
More informationIs Gravity an Entropic Force?
Is Gravity an Entropic Force? San Gao Unit for HPS & Centre for Time, SOPHI, University of Sydney, Sydney, NSW 006, Australia; EMail: sgao7319@uni.sydney.edu.au Abstract: Te remarkable connections between
More informationDetermine the perimeter of a triangle using algebra Find the area of a triangle using the formula
Student Name: Date: Contact Person Name: Pone Number: Lesson 0 Perimeter, Area, and Similarity of Triangles Objectives Determine te perimeter of a triangle using algebra Find te area of a triangle using
More informationIn other words the graph of the polynomial should pass through the points
Capter 3 Interpolation Interpolation is te problem of fitting a smoot curve troug a given set of points, generally as te grap of a function. It is useful at least in data analysis (interpolation is a form
More informationFinite Volume Discretization of the Heat Equation
Lecture Notes 3 Finite Volume Discretization of te Heat Equation We consider finite volume discretizations of te onedimensional variable coefficient eat equation, wit Neumann boundary conditions u t x
More informationOptimization Of Vapor Compression Systems Via Simulation
Purdue University Purdue epubs International Refrigeration and Air Conditioning Conference Scool of Mecanical Engineering 2002 Optimization Of Vapor Compression Systems Via Simulation D. H. Ricardson
More informationarxiv:math/ v1 [math.pr] 20 Feb 2003
JUGGLING PROBABILITIES GREGORY S. WARRINGTON arxiv:mat/0302257v [mat.pr] 20 Feb 2003. Introduction Imagine yourself effortlessly juggling five balls in a ig, lazy pattern. Your rigt and catces a ball and
More informationIn their classic textbook, Musgrave and Musgrave (1989)
Integrating Expenditure and Tax Decisions Integrating Expenditure and Tax Decisions: Te Marginal Cost of Funds and te Marginal Benefit of Projects Abstract  Tis paper seeks to clarify te extent to wic
More informationProof of the Power Rule for Positive Integer Powers
Te Power Rule A function of te form f (x) = x r, were r is any real number, is a power function. From our previous work we know tat x x 2 x x x x 3 3 x x In te first two cases, te power r is a positive
More information2.23 Gambling Rehabilitation Services. Introduction
2.23 Gambling Reabilitation Services Introduction Figure 1 Since 1995 provincial revenues from gambling activities ave increased over 56% from $69.2 million in 1995 to $108 million in 2004. Te majority
More informationschema binary search tree schema binary search trees data structures and algorithms 2015 09 21 lecture 7 AVLtrees material
scema binary searc trees data structures and algoritms 05 0 lecture 7 VLtrees material scema binary searc tree binary tree: linked data structure wit nodes containing binary searc trees VLtrees material
More informationSection 3.3. Differentiation of Polynomials and Rational Functions. Difference Equations to Differential Equations
Difference Equations to Differential Equations Section 3.3 Differentiation of Polynomials an Rational Functions In tis section we begin te task of iscovering rules for ifferentiating various classes of
More informationLecture 10. Limits (cont d) Onesided limits. (Relevant section from Stewart, Seventh Edition: Section 2.4, pp. 113.)
Lecture 10 Limits (cont d) Onesided its (Relevant section from Stewart, Sevent Edition: Section 2.4, pp. 113.) As you may recall from your earlier course in Calculus, we may define onesided its, were
More information2.15 Water Quality Management. Introduction
Introduction In May 2001, Government released a report entitled Source to Tap  Water Supplies in Newfoundland and Labrador (Source to Tap report). Te report was prepared in response to drinking water
More informationP.4 Rational Expressions
7_0P04.qp /7/06 9:4 AM Page 7 Section P.4 Rational Epressions 7 P.4 Rational Epressions Domain of an Algebraic Epression Te set of real numbers for wic an algebraic epression is defined is te domain of
More informationNotes: Most of the material in this chapter is taken from Young and Freedman, Chap. 12.
Capter 6. Fluid Mecanics Notes: Most of te material in tis capter is taken from Young and Freedman, Cap. 12. 6.1 Fluid Statics Fluids, i.e., substances tat can flow, are te subjects of tis capter. But
More informationArea of a Parallelogram
Area of a Parallelogram Focus on After tis lesson, you will be able to... φ develop te φ formula for te area of a parallelogram calculate te area of a parallelogram One of te sapes a marcing band can make
More informationFINITE DIFFERENCE METHODS
FINITE DIFFERENCE METHODS LONG CHEN Te best known metods, finite difference, consists of replacing eac derivative by a difference quotient in te classic formulation. It is simple to code and economic to
More informationHardness Measurement of Metals Static Methods
Hardness Testing Principles and Applications Copyrigt 2011 ASM International Konrad Herrmann, editor All rigts reserved. www.asminternational.org Capter 2 Hardness Measurement of Metals Static Metods T.
More informationImproved dynamic programs for some batcing problems involving te maximum lateness criterion A P M Wagelmans Econometric Institute Erasmus University Rotterdam PO Box 1738, 3000 DR Rotterdam Te Neterlands
More informationSchedulability Analysis under Graph Routing in WirelessHART Networks
Scedulability Analysis under Grap Routing in WirelessHART Networks Abusayeed Saifulla, Dolvara Gunatilaka, Paras Tiwari, Mo Sa, Cenyang Lu, Bo Li Cengjie Wu, and Yixin Cen Department of Computer Science,
More informationBackground Facts on Economic Statistics
Background Facts on Economic Statistics 2003:3 SAMU Te system for coordination of frame populations and samples from te Business Register at Statistics Sweden epartment of Economic Statistics Te series
More informationHEXAGON FLOWERS CUTTING OUT 1 COVERING THE FLOWERS 2
YOU WILL NEED Small scraps of fabric to cover fourteen exagons (includes enoug for front and back) Ribbon 6½in lengt Fourteen paper exagon templates (I used a size, but any would be fine, as long as you
More informationReliability and Route Diversity in Wireless Networks
Reliability and Route Diversity in Wireless Networks Amir E. Kandani, Jinane Abounadi, Eytan Modiano, and Lizong Zeng Abstract We study te problem of communication reliability of wireless networks in a
More informationWhat is Advanced Corporate Finance? What is finance? What is Corporate Finance? Deciding how to optimally manage a firm s assets and liabilities.
Wat is? Spring 2008 Note: Slides are on te web Wat is finance? Deciding ow to optimally manage a firm s assets and liabilities. Managing te costs and benefits associated wit te timing of cas in and outflows
More informationChapter 10: Refrigeration Cycles
Capter 10: efrigeration Cycles Te vapor compression refrigeration cycle is a common metod for transferring eat from a low temperature to a ig temperature. Te above figure sows te objectives of refrigerators
More informationKM client format supported by KB valid from 13 May 2015
supported by KB valid from 13 May 2015 1/16 VRSION 1.2. UPDATD: 13.12.2005. 1 Introduction... 2 1.1 Purpose of tis document... 2 1.2 Caracteristics of te KM format... 2 2 Formal ceck of KM format... 3
More information2 Limits and Derivatives
2 Limits and Derivatives 2.7 Tangent Lines, Velocity, and Derivatives A tangent line to a circle is a line tat intersects te circle at exactly one point. We would like to take tis idea of tangent line
More informationSystemic financial risk: agent based models to understand the leverage cycle on national scales and its consequences
IFP/WKP/FGS(2011)1 MULTIDISCIPLINARY ISSUES INTERNATIONAL FUTURES PROGRAMME OECD/IFP Project on Future Global Socks Systemic financial risk: agent based models to understand te leverage cycle on national
More informationAn Interest Rate Model
An Interest Rate Model Concepts and Buzzwords Building Price Tree from Rate Tree Lognormal Interest Rate Model Nonnegativity Volatility and te Level Effect Readings Tuckman, capters 11 and 12. Lognormal
More informationPredicting the behavior of interacting humans by fusing data from multiple sources
Predicting te beavior of interacting umans by fusing data from multiple sources Erik J. Sclict 1, Ritcie Lee 2, David H. Wolpert 3,4, Mykel J. Kocenderfer 1, and Brendan Tracey 5 1 Lincoln Laboratory,
More informationDesign and Analysis of a FaultTolerant Mechanism for a ServerLess VideoOnDemand System
Design and Analysis of a Faultolerant Mecanism for a ServerLess VideoOnDemand System Jack Y. B. Lee Department of Information Engineering e Cinese University of Hong Kong Satin, N.., Hong Kong Email:
More informationComparison between two approaches to overload control in a Real Server: local or hybrid solutions?
Comparison between two approaces to overload control in a Real Server: local or ybrid solutions? S. Montagna and M. Pignolo Researc and Development Italtel S.p.A. Settimo Milanese, ITALY Abstract Tis wor
More informationComputer Vision System for Tracking Players in Sports Games
Computer Vision System for Tracking Players in Sports Games Abstract Janez Perš, Stanislav Kovacic Faculty of Electrical Engineering, University of Lublana Tržaška 5, 000 Lublana anez.pers@kiss.unil.si,
More informationMath WarmUp for Exam 1 Name: Solutions
Disclaimer: Tese review problems do not represent te exact questions tat will appear te exam. Tis is just a warmup to elp you begin studying. It is your responsibility to review te omework problems, webwork
More information