Algorithms Design & Analysis. Hash Tables

Size: px
Start display at page:

Download "Algorithms Design & Analysis. Hash Tables"

Transcription

1 Algorthms Desg & Aalyss Hash Tables

2 Recap Lower boud Order statstcs 2

3 Today s topcs Drect-accessble table Hash tables Hash fuctos Uversal hashg Perfect Hashg Ope addressg 3

4 Symbol-table problem Symbol table T holdg records: x record key[x] Other felds cotag satellte data Operatos o T: INSERT(T,x) DELETE(T,x) SEARCH(T,k) How should the data structure T be orgazed? 4

5 Drect-accessble table IDEA: Suppose that the set of keys s K {,,, m }, ad keys are dstct. Set up a array T[.. m ]: x f k K ad keys[x] = k T [ k] = NIL otherwse. The, operatos take Θ() tme. Problem: The rage of keys ca be large: 64-bt umbers (whch represet 8,446,744,73,79,55,66 dfferet keys), character strgs (eve larger!). 5

6 Hash fuctos Soluto: Use a hash fucto h to map the T uverse U of all keys to {,,, m }: h(k ) h(k 4 ) K k k 5 k 4 k 2 k 3 h(k 2 ) = h(k 5 ) h(k 3 ) m- Whe a record to be serted maps to a already occuped slot T, a collso occurs. 6

7 Resolvg collsos by chag Records the same slot are lked to a lst. T h(49) = h(86) = h(52) = 7

8 Aalyss of chag We make the assumpto of smple uform hashg: Each key k K of keys s equally lkely to be hashed to ay slot of table T, depedet of where other keys are hashed. Let be the umber of keys the table, ad let m be the umber of slots. Defe the load factor of T to be α = /m = average umber of keys per slot. 8

9 Search cost Expected tme to search for a record wth a gve key = Θ( + α). apply hash fucto ad access slot search the lst Expected search tme = Θ() f α = O(), or equvaletly, f = O(m). 9

10 Choosg a hash fucto The assumpto of smple uform hashg s hard to guaratee, but several commo techques ted to work well practce as log as ther defceces ca be avoded. Desderata: A good hash fucto should dstrbute the keys uformly to the slots of the table. Regularty the key dstrbuto should ot affect ths uformty.

11 Dvso method Assume all keys are tegers, ad defe h(k) = k mod m. Defcecy: Do t pck a m that has a small dvsor d. A prepoderace of keys that are cogruet modulo d ca adversely affect uformty.

12 Dvso method Extreme defcecy: If m = 2 r, the the hash does t eve deped o all the bts of k: If k = 2 ad r = 6, the $!!! #!! h(k) = 2. h(k)! " 2

13 Dvso method h(k) = k mod m. Pck m to be a prme ot too close to a power of 2 or ad ot otherwse used prometly the computg evromet. Aoyace: Sometmes, makg the table sze a prme s coveet. But, ths method s popular, although the ext method we ll see s usually superor. 3

14 Dot-product method Radomzed strategy: Let m be prme. Decompose key k to r + dgts, each wth value the set {,,, m }. That s, let k = <k, k,, k r >, where k < m. Pck a = <a, a,, a r > where each a s chose radomly from {,,, m }. Defe h a ( k) = r = a k mod m Excellet practce, but expesve to compute. 4

15 A weakess of hashg as we saw t Problem: For ay hash fucto h, a set of keys exsts that ca cause the average access tme of a hash table to skyrocket. A adversary ca pck all keys from {k U : h(k) = } for some slot. 5

16 A weakess of hashg as we saw t IDEA: Choose the hash fucto at radom, depedetly of the keys. Eve f a adversary ca see your code, he or she caot fd a bad set of keys, sce he or she does t kow exactly whch hash fucto wll be chose. 6

17 Uversal hashg Defto. Let U be a uverse of keys, ad let H be a fte collecto of hash fuctos, each mappg U to {,,, m }. We say H s uversal f for all x, y U, where x y, we have {h H: h(x) = h(y)} = H /m. That s, the chace of a collso betwee x ad y s /m f we choose h radomly from H. {h: h(x) = h(y)} H m H 7

18 Uversalty s good Theorem. Let h be a hash fucto chose (uformly) at radom from a uversal set H of hash fuctos. Suppose h s used to hash arbtrary keys to the m slots of a table T. The, for a gve key x, we have E[#collsos wth x] < /m 8

19 Proof of the theorem Proof. Let C x be the radom varable deotg the total umber of collsos of keys T wth x, ad let c xy = f h(x) = h(y), otherwse. Note: E[c xy ] = /m ad C x = c xy y T {x} 9

20 Proof (cot.) E[ C ] = E y T { x c xy x} Take expectato of both sdes. = E[ y T { x} c xy ] Learty of expectato. = / y T { x} m m E[c xy ] = /m = Algebra. 2

21 Costructg a set of uversal hash fuctos Let m be prme. Decompose key k to r + dgts, each wth value the set {,,, m }. That s, let k = k, k,, k r, where k < m. Radomzed strategy: Pck a = a, a,, a r where each a s chose radomly from {,,, m }. Defe h a ( k) = r = a k mod m How bg s H = {h a }? H = m r+ Dot product, modulo m 2

22 Uversalty of dot-product hash fuctos Theorem. The set H = {h a } s uversal. Proof. Suppose that x = x, x,, x r ad y = y, y,, y r are dstct keys. Thus, they dffer at least oe dgt posto, wlog posto. For how may h a H do x ad y collde? h a ( x) = h a ( y) r = a x r = a y (mod m) 22

23 23 Proof (cot.) Equvaletly, we have or whch mples that ) (mod ) ( m y x a r = ) (mod ) ( ) ( m y x a y x a r + = ) (mod ) ( ) ( m y x a y x a r =

24 Fact from umber theory Theorem. Let m be prme. For ay z Z m such that z, there exsts a uque z Z m such that Example: m = 7. z z (mod m). z z

25 25 Back to the proof We have ad sce x y, a verse (x y ) must exst, whch mples that Thus, for ay choces of a, a 2,, a r, exactly oe choce of a causes x ad y to collde. ) (mod ) ( ) ( m y x a y x a r = ) (mod ) ( ) ( m y x y x a a r =

26 Proof completed Q. How may h a s cause x ad y to collde? A. There are m choces for each of a, a 2,, a r, but oce these are chose, exactly oe choce for a causes x ad y to collde, amely r a a ( x y ) ( x y) (mod m) = Thus, the umber of h a s that cause x ad y to collde s m r = m r = H /m. 26

27 Perfect hashg Gve a set of keys, costruct a statc hash table of sze m = O() such that SEARCH takes Θ() tme the worst case. IDEA: Twolevel scheme wth uversal hashg at both levels. No collsos at level 2! T S 4 26 S $!!!!! #!!!!!! " 4 27 h 3 (4) = h 3 (27) = $!!!!!!!!!!!! #!!!!!!!!!!!!! " m a S 6

28 Collsos at level 2 Theorem. Let H be a class of uversal hash fuctos for a table of sze m = 2. The, f we use a radom h H to hash keys to the table, the expected umber of collsos s at most /2. 28

29 Collsos at level 2 Proof. By the defto of uversalty, the probablty that 2 gve keys the table collde uder h s /m = / 2. Sce there are pars of keys that ca possbly collde, the expected umber of collsos s 2 2 ( ) 2 = <

30 No Collsos at level 2 Corollary. The probablty of o collsos s at least /2. Proof. Markov s equalty says that for ay oegatve radom varable X, we have Pr{X t} E[X]/t. Applyg ths equalty wth t =, we fd that the probablty of or more collsos s at most /2. Thus, just by testg radom hash fuctos H, we ll quckly fd oe that works. 3

31 Aalyss of storage Theorem. If we store keys a hash table of sze m = usg a hash fucto h radomly chose from a uversal class of hash fuctos, the m E j= 2 j < 2 where j s the umber of keys hashg to slot j. 3

32 32 Proof of the Theorem The summato s just the total umbers of collsos. Use fact + = = = m j j j m j j E E + = a a a + = = 2 2 ] [ m j j E E + = = = 2 2 m j j m j j E E Learty of expectato + = = 2 2 m j j E s ot a radom varable = 2 m j j

33 33 Proof of the Theorem (cot.) By the propertes of uversal hashg, the expected value of the summato s at most: sce m =, thus 2 2 ) ( 2 = = m m = E m j j 2 2 < =

34 Aalyss of storage (cot.) Corollary. If we store keys a hash table of sze m = usg a hash fucto h radomly chose from uversal class of hash fuctos ad we set the sze of each secodary hash table to m j = j 2 for j =,,,m-, the the expected amout of storage requred for all secodary hash tables a perfect hashg scheme s less tha 2. 34

35 Resolvg collsos by ope addressg No storage s used outsde of the hash table tself. Iserto systematcally probes the table utl a empty slot s foud. The hash fucto depeds o both the key ad probe umber: h : U {,,, m } {,,, m }. The probe sequece <h(k,), h(k,),, h(k,m )> should be a permutato of {,,, m }. The table may fll up, ad deleto s dffcult (but ot mpossble). 35

36 Example of ope addressg Isert key k = 496:. Probe h(496, ) T collso 48 m- 36

37 Example of ope addressg Isert key k = 496: T. Probe h(496, ). Probe h(496, ) 586 collso m- 37

38 Example of ope addressg Isert key k = 496: T. Probe h(496, ). Probe h(496, ) 2. Probe h(496, 2) serto 48 m- 38

39 Example of ope addressg Isert key k = 496: T. Probe h(496, ). Probe h(496, ) 2. Probe h(496, 2) Search uses the same probe 48 sequece, termatg successfully f t fds the m- key ad usuccessfully f t ecouters a empty slot

40 Probg strateges Lear probg: Gve a ordary hash fucto hʹ (k), lear probg uses the hash fucto h(k,) = (hʹ (k) + ) mod m. Ths method, though smple, suffers from prmary clusterg, where log rus of occuped slots buld up, creasg the average search tme. Moreover, the log rus of occuped slots ted to get loger. 4

41 Probg strateges Double hashg Gve two ordary hash fuctos h (k) ad h 2 (k), double hashg uses the hash fucto h(k,) = (h (k) + h 2 (k)) mod m. Ths method geerally produces excellet results, but h 2 (k) must be relatvely prme to m. Oe way s to make m a power of 2 ad desg h 2 (k) to produce oly odd umbers. 4

42 Aalyss of ope addressg We make the assumpto of uform hashg: Each key s equally lkely to have ay oe of the m! permutatos as ts probe sequece. Theorem. Gve a ope-addressed hash table wth load factor α = /m <, the expected umber of probes a usuccessful search s at most /( α). 42

43 Proof of the theorem Proof. At least oe probe s always ecessary. Wth probablty /m, the frst probe hts a occuped slot, ad a secod probe s ecessary. Wth probablty ( )/(m ), the secod probe hts a occuped slot, ad a thrd probe s ecessary. Wth probablty ( 2)/(m 2), the thrd probe hts a occuped slot, etc. m m Observe that < = α for =, 2,,. 43

44 44 Proof (cotued) Therefore, the expected umber of probes s α α α α α α α α α = = = ))) ) ( ( ( ( m m m m!!!!!

45 Implcatos of the theorem If α s costat, the accessg a ope addressed hash table takes costat tme. If the table s half full, the the expected umber of probes s /(.5) = 2. If the table s 9% full, the the expected umber of probes s /(.9) =. 45

46 Amortzed aalyss Next Week 46

47 Multplcato method Assume that all keys are tegers, m = 2 r, ad our computer has w-bt words. Defe h(k) = (A k mod 2 w ) rsh (w r), where rsh s the bt-wse rght-shft operator ad A s a odd teger the rage 2 w < A < 2 w. Do t pck A too close to 2 w. Multplcato modulo 2 w s fast. The rsh operator s fast. 47

48 Multplcato method example h(k) = (A k mod 2 w ) rsh (w r) Suppose that m = 8 = 2 3 ad that our computer has w = 7-bt words: = A = k $!#!" h(k) Modular wheel 48

Introduction to Algorithms

Introduction to Algorithms Introducton to Algorthms 6.046J/8.40J Lecture 7 Prof. Potr Indyk Data Structures Role of data structures: Encapsulate data Support certan operatons (e.g., INSERT, DELETE, SEARCH) Our focus: effcency of

More information

Introduction to Algorithms

Introduction to Algorithms Introducton to Algorthms 6.046J/18.401J Lecture 7 Prof. Potr Indyk Data Structures Role of data structures: Encapsulate data Support certan operatons (e.g., INSERT, DELETE, SEARCH) What data structures

More information

8.1 Hashing Algorithms

8.1 Hashing Algorithms CS787: Advaced Algorthms Scrbe: Mayak Maheshwar, Chrs Hrchs Lecturer: Shuch Chawla Topc: Hashg ad NP-Completeess Date: September 21 2007 Prevously we looked at applcatos of radomzed algorthms, ad bega

More information

Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand DIS 10b

Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand DIS 10b CS 70 Dscrete Mathematcs ad Probablty Theory Fall 206 Sesha ad Walrad DIS 0b. Wll I Get My Package? Seaky delvery guy of some compay s out delverg packages to customers. Not oly does he had a radom package

More information

MA/CSSE 473 Day 27. Dynamic programming

MA/CSSE 473 Day 27. Dynamic programming MA/CSSE 473 Day 7 Dyamc Programmg Bomal Coeffcets Warshall's algorthm (Optmal BSTs) Studet questos? Dyamc programmg Used for problems wth recursve solutos ad overlappg subproblems Typcally, we save (memoze)

More information

CS286.2 Lecture 4: Dinur s Proof of the PCP Theorem

CS286.2 Lecture 4: Dinur s Proof of the PCP Theorem CS86. Lecture 4: Dur s Proof of the PCP Theorem Scrbe: Thom Bohdaowcz Prevously, we have prove a weak verso of the PCP theorem: NP PCP 1,1/ (r = poly, q = O(1)). Wth ths result we have the desred costat

More information

Econometric Methods. Review of Estimation

Econometric Methods. Review of Estimation Ecoometrc Methods Revew of Estmato Estmatg the populato mea Radom samplg Pot ad terval estmators Lear estmators Ubased estmators Lear Ubased Estmators (LUEs) Effcecy (mmum varace) ad Best Lear Ubased Estmators

More information

Lecture 9: Tolerant Testing

Lecture 9: Tolerant Testing Lecture 9: Tolerat Testg Dael Kae Scrbe: Sakeerth Rao Aprl 4, 07 Abstract I ths lecture we prove a quas lear lower boud o the umber of samples eeded to do tolerat testg for L dstace. Tolerat Testg We have

More information

CHAPTER 4 RADICAL EXPRESSIONS

CHAPTER 4 RADICAL EXPRESSIONS 6 CHAPTER RADICAL EXPRESSIONS. The th Root of a Real Number A real umber a s called the th root of a real umber b f Thus, for example: s a square root of sce. s also a square root of sce ( ). s a cube

More information

Chapter 5 Properties of a Random Sample

Chapter 5 Properties of a Random Sample Lecture 6 o BST 63: Statstcal Theory I Ku Zhag, /0/008 Revew for the prevous lecture Cocepts: t-dstrbuto, F-dstrbuto Theorems: Dstrbutos of sample mea ad sample varace, relatoshp betwee sample mea ad sample

More information

Pseudo-random Functions

Pseudo-random Functions Pseudo-radom Fuctos Debdeep Mukhopadhyay IIT Kharagpur We have see the costructo of PRG (pseudo-radom geerators) beg costructed from ay oe-way fuctos. Now we shall cosder a related cocept: Pseudo-radom

More information

Chapter 9 Jordan Block Matrices

Chapter 9 Jordan Block Matrices Chapter 9 Jorda Block atrces I ths chapter we wll solve the followg problem. Gve a lear operator T fd a bass R of F such that the matrx R (T) s as smple as possble. f course smple s a matter of taste.

More information

Algorithms Theory, Solution for Assignment 2

Algorithms Theory, Solution for Assignment 2 Juor-Prof. Dr. Robert Elsässer, Marco Muñz, Phllp Hedegger WS 2009/200 Algorthms Theory, Soluto for Assgmet 2 http://lak.formatk.u-freburg.de/lak_teachg/ws09_0/algo090.php Exercse 2. - Fast Fourer Trasform

More information

The Occupancy and Coupon Collector problems

The Occupancy and Coupon Collector problems Chapter 4 The Occupacy ad Coupo Collector problems By Sarel Har-Peled, Jauary 9, 08 4 Prelmares [ Defto 4 Varace ad Stadard Devato For a radom varable X, let V E [ X [ µ X deote the varace of X, where

More information

Special Instructions / Useful Data

Special Instructions / Useful Data JAM 6 Set of all real umbers P A..d. B, p Posso Specal Istructos / Useful Data x,, :,,, x x Probablty of a evet A Idepedetly ad detcally dstrbuted Bomal dstrbuto wth parameters ad p Posso dstrbuto wth

More information

best estimate (mean) for X uncertainty or error in the measurement (systematic, random or statistical) best

best estimate (mean) for X uncertainty or error in the measurement (systematic, random or statistical) best Error Aalyss Preamble Wheever a measuremet s made, the result followg from that measuremet s always subject to ucertaty The ucertaty ca be reduced by makg several measuremets of the same quatty or by mprovg

More information

Introduction to Probability

Introduction to Probability Itroducto to Probablty Nader H Bshouty Departmet of Computer Scece Techo 32000 Israel e-mal: bshouty@cstechoacl 1 Combatorcs 11 Smple Rules I Combatorcs The rule of sum says that the umber of ways to choose

More information

18.413: Error Correcting Codes Lab March 2, Lecture 8

18.413: Error Correcting Codes Lab March 2, Lecture 8 18.413: Error Correctg Codes Lab March 2, 2004 Lecturer: Dael A. Spelma Lecture 8 8.1 Vector Spaces A set C {0, 1} s a vector space f for x all C ad y C, x + y C, where we take addto to be compoet wse

More information

For combinatorial problems we might need to generate all permutations, combinations, or subsets of a set.

For combinatorial problems we might need to generate all permutations, combinations, or subsets of a set. Addtoal Decrease ad Coquer Algorthms For combatoral problems we mght eed to geerate all permutatos, combatos, or subsets of a set. Geeratg Permutatos If we have a set f elemets: { a 1, a 2, a 3, a } the

More information

,m = 1,...,n; 2 ; p m (1 p) n m,m = 0,...,n; E[X] = np; n! e λ,n 0; E[X] = λ.

,m = 1,...,n; 2 ; p m (1 p) n m,m = 0,...,n; E[X] = np; n! e λ,n 0; E[X] = λ. CS70: Lecture 21. Revew: Dstrbutos Revew: Idepedece Varace; Iequaltes; WLLN 1. Revew: Dstrbutos 2. Revew: Idepedece 3. Varace 4. Iequaltes Markov Chebyshev 5. Weak Law of Large Numbers U[1,...,] : Pr[X

More information

Hard Core Predicates: How to encrypt? Recap

Hard Core Predicates: How to encrypt? Recap Hard Core Predcates: How to ecrypt? Debdeep Mukhopadhyay IIT Kharagpur Recap A ecrypto scheme s secured f for every probablstc adversary A carryg out some specfed kd of attack ad for every polyomal p(.),

More information

{ }{ ( )} (, ) = ( ) ( ) ( ) Chapter 14 Exercises in Sampling Theory. Exercise 1 (Simple random sampling): Solution:

{ }{ ( )} (, ) = ( ) ( ) ( ) Chapter 14 Exercises in Sampling Theory. Exercise 1 (Simple random sampling): Solution: Chapter 4 Exercses Samplg Theory Exercse (Smple radom samplg: Let there be two correlated radom varables X ad A sample of sze s draw from a populato by smple radom samplg wthout replacemet The observed

More information

Homework 1: Solutions Sid Banerjee Problem 1: (Practice with Asymptotic Notation) ORIE 4520: Stochastics at Scale Fall 2015

Homework 1: Solutions Sid Banerjee Problem 1: (Practice with Asymptotic Notation) ORIE 4520: Stochastics at Scale Fall 2015 Fall 05 Homework : Solutos Problem : (Practce wth Asymptotc Notato) A essetal requremet for uderstadg scalg behavor s comfort wth asymptotc (or bg-o ) otato. I ths problem, you wll prove some basc facts

More information

Computational Geometry

Computational Geometry Problem efto omputatoal eometry hapter 6 Pot Locato Preprocess a plaar map S. ve a query pot p, report the face of S cotag p. oal: O()-sze data structure that eables O(log ) query tme. pplcato: Whch state

More information

9 U-STATISTICS. Eh =(m!) 1 Eh(X (1),..., X (m ) ) i.i.d

9 U-STATISTICS. Eh =(m!) 1 Eh(X (1),..., X (m ) ) i.i.d 9 U-STATISTICS Suppose,,..., are P P..d. wth CDF F. Our goal s to estmate the expectato t (P)=Eh(,,..., m ). Note that ths expectato requres more tha oe cotrast to E, E, or Eh( ). Oe example s E or P((,

More information

This lecture and the next. Why Sorting? Sorting Algorithms so far. Why Sorting? (2) Selection Sort. Heap Sort. Heapsort

This lecture and the next. Why Sorting? Sorting Algorithms so far. Why Sorting? (2) Selection Sort. Heap Sort. Heapsort Ths lecture ad the ext Heapsort Heap data structure ad prorty queue ADT Qucksort a popular algorthm, very fast o average Why Sortg? Whe doubt, sort oe of the prcples of algorthm desg. Sortg used as a subroute

More information

X X X E[ ] E X E X. is the ()m n where the ( i,)th. j element is the mean of the ( i,)th., then

X X X E[ ] E X E X. is the ()m n where the ( i,)th. j element is the mean of the ( i,)th., then Secto 5 Vectors of Radom Varables Whe workg wth several radom varables,,..., to arrage them vector form x, t s ofte coveet We ca the make use of matrx algebra to help us orgaze ad mapulate large umbers

More information

X ε ) = 0, or equivalently, lim

X ε ) = 0, or equivalently, lim Revew for the prevous lecture Cocepts: order statstcs Theorems: Dstrbutos of order statstcs Examples: How to get the dstrbuto of order statstcs Chapter 5 Propertes of a Radom Sample Secto 55 Covergece

More information

Pseudo-random Functions. PRG vs PRF

Pseudo-random Functions. PRG vs PRF Pseudo-radom Fuctos Debdeep Muhopadhyay IIT Kharagpur PRG vs PRF We have see the costructo of PRG (pseudo-radom geerators) beg costructed from ay oe-way fuctos. Now we shall cosder a related cocept: Pseudo-radom

More information

The Mathematical Appendix

The Mathematical Appendix The Mathematcal Appedx Defto A: If ( Λ, Ω, where ( λ λ λ whch the probablty dstrbutos,,..., Defto A. uppose that ( Λ,,..., s a expermet type, the σ-algebra o λ λ λ are defed s deoted by ( (,,...,, σ Ω.

More information

The Selection Problem - Variable Size Decrease/Conquer (Practice with algorithm analysis)

The Selection Problem - Variable Size Decrease/Conquer (Practice with algorithm analysis) We have covered: Selecto, Iserto, Mergesort, Bubblesort, Heapsort Next: Selecto the Qucksort The Selecto Problem - Varable Sze Decrease/Coquer (Practce wth algorthm aalyss) Cosder the problem of fdg the

More information

Introduction to local (nonparametric) density estimation. methods

Introduction to local (nonparametric) density estimation. methods Itroducto to local (oparametrc) desty estmato methods A slecture by Yu Lu for ECE 66 Sprg 014 1. Itroducto Ths slecture troduces two local desty estmato methods whch are Parze desty estmato ad k-earest

More information

Lecture 2 - What are component and system reliability and how it can be improved?

Lecture 2 - What are component and system reliability and how it can be improved? Lecture 2 - What are compoet ad system relablty ad how t ca be mproved? Relablty s a measure of the qualty of the product over the log ru. The cocept of relablty s a exteded tme perod over whch the expected

More information

Lecture: Analysis of Algorithms (CS )

Lecture: Analysis of Algorithms (CS ) Lecture: Analysis of Algorithms (CS483-001) Amarda Shehu Spring 2017 1 Outline of Today s Class 2 Choosing Hash Functions Universal Universality Theorem Constructing a Set of Universal Hash Functions Perfect

More information

ENGI 3423 Simple Linear Regression Page 12-01

ENGI 3423 Simple Linear Regression Page 12-01 ENGI 343 mple Lear Regresso Page - mple Lear Regresso ometmes a expermet s set up where the expermeter has cotrol over the values of oe or more varables X ad measures the resultg values of aother varable

More information

Lecture 3 Probability review (cont d)

Lecture 3 Probability review (cont d) STATS 00: Itroducto to Statstcal Iferece Autum 06 Lecture 3 Probablty revew (cot d) 3. Jot dstrbutos If radom varables X,..., X k are depedet, the ther dstrbuto may be specfed by specfyg the dvdual dstrbuto

More information

Lecture 02: Bounding tail distributions of a random variable

Lecture 02: Bounding tail distributions of a random variable CSCI-B609: A Theorst s Toolkt, Fall 206 Aug 25 Lecture 02: Boudg tal dstrbutos of a radom varable Lecturer: Yua Zhou Scrbe: Yua Xe & Yua Zhou Let us cosder the ubased co flps aga. I.e. let the outcome

More information

(b) By independence, the probability that the string 1011 is received correctly is

(b) By independence, the probability that the string 1011 is received correctly is Soluto to Problem 1.31. (a) Let A be the evet that a 0 s trasmtted. Usg the total probablty theorem, the desred probablty s P(A)(1 ɛ ( 0)+ 1 P(A) ) (1 ɛ 1)=p(1 ɛ 0)+(1 p)(1 ɛ 1). (b) By depedece, the probablty

More information

Chapter 14 Logistic Regression Models

Chapter 14 Logistic Regression Models Chapter 4 Logstc Regresso Models I the lear regresso model X β + ε, there are two types of varables explaatory varables X, X,, X k ad study varable y These varables ca be measured o a cotuous scale as

More information

D. VQ WITH 1ST-ORDER LOSSLESS CODING

D. VQ WITH 1ST-ORDER LOSSLESS CODING VARIABLE-RATE VQ (AKA VQ WITH ENTROPY CODING) Varable-Rate VQ = Quatzato + Lossless Varable-Legth Bary Codg A rage of optos -- from smple to complex A. Uform scalar quatzato wth varable-legth codg, oe

More information

CHAPTER VI Statistical Analysis of Experimental Data

CHAPTER VI Statistical Analysis of Experimental Data Chapter VI Statstcal Aalyss of Expermetal Data CHAPTER VI Statstcal Aalyss of Expermetal Data Measuremets do ot lead to a uque value. Ths s a result of the multtude of errors (maly radom errors) that ca

More information

UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS

UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS Postpoed exam: ECON430 Statstcs Date of exam: Jauary 0, 0 Tme for exam: 09:00 a.m. :00 oo The problem set covers 5 pages Resources allowed: All wrtte ad prted

More information

The internal structure of natural numbers, one method for the definition of large prime numbers, and a factorization test

The internal structure of natural numbers, one method for the definition of large prime numbers, and a factorization test Fal verso The teral structure of atural umbers oe method for the defto of large prme umbers ad a factorzato test Emmaul Maousos APM Isttute for the Advacemet of Physcs ad Mathematcs 3 Poulou str. 53 Athes

More information

Median as a Weighted Arithmetic Mean of All Sample Observations

Median as a Weighted Arithmetic Mean of All Sample Observations Meda as a Weghted Arthmetc Mea of All Sample Observatos SK Mshra Dept. of Ecoomcs NEHU, Shllog (Ida). Itroducto: Iumerably may textbooks Statstcs explctly meto that oe of the weakesses (or propertes) of

More information

PTAS for Bin-Packing

PTAS for Bin-Packing CS 663: Patter Matchg Algorthms Scrbe: Che Jag /9/00. Itroducto PTAS for B-Packg The B-Packg problem s NP-hard. If we use approxmato algorthms, the B-Packg problem could be solved polyomal tme. For example,

More information

Chapter 8. Inferences about More Than Two Population Central Values

Chapter 8. Inferences about More Than Two Population Central Values Chapter 8. Ifereces about More Tha Two Populato Cetral Values Case tudy: Effect of Tmg of the Treatmet of Port-We tas wth Lasers ) To vestgate whether treatmet at a youg age would yeld better results tha

More information

f f... f 1 n n (ii) Median : It is the value of the middle-most observation(s).

f f... f 1 n n (ii) Median : It is the value of the middle-most observation(s). CHAPTER STATISTICS Pots to Remember :. Facts or fgures, collected wth a defte pupose, are called Data.. Statstcs s the area of study dealg wth the collecto, presetato, aalyss ad terpretato of data.. The

More information

MATH 247/Winter Notes on the adjoint and on normal operators.

MATH 247/Winter Notes on the adjoint and on normal operators. MATH 47/Wter 00 Notes o the adjot ad o ormal operators I these otes, V s a fte dmesoal er product space over, wth gve er * product uv, T, S, T, are lear operators o V U, W are subspaces of V Whe we say

More information

Summary of the lecture in Biostatistics

Summary of the lecture in Biostatistics Summary of the lecture Bostatstcs Probablty Desty Fucto For a cotuos radom varable, a probablty desty fucto s a fucto such that: 0 dx a b) b a dx A probablty desty fucto provdes a smple descrpto of the

More information

Chapter 4 Multiple Random Variables

Chapter 4 Multiple Random Variables Revew for the prevous lecture: Theorems ad Examples: How to obta the pmf (pdf) of U = g (, Y) ad V = g (, Y) Chapter 4 Multple Radom Varables Chapter 44 Herarchcal Models ad Mxture Dstrbutos Examples:

More information

Simple Linear Regression

Simple Linear Regression Statstcal Methods I (EST 75) Page 139 Smple Lear Regresso Smple regresso applcatos are used to ft a model descrbg a lear relatoshp betwee two varables. The aspects of least squares regresso ad correlato

More information

å 1 13 Practice Final Examination Solutions - = CS109 Dec 5, 2018

å 1 13 Practice Final Examination Solutions - = CS109 Dec 5, 2018 Chrs Pech Fal Practce CS09 Dec 5, 08 Practce Fal Examato Solutos. Aswer: 4/5 8/7. There are multle ways to obta ths aswer; here are two: The frst commo method s to sum over all ossbltes for the rak of

More information

Lecture 4 Sep 9, 2015

Lecture 4 Sep 9, 2015 CS 388R: Radomzed Algorthms Fall 205 Prof. Erc Prce Lecture 4 Sep 9, 205 Scrbe: Xagru Huag & Chad Voegele Overvew I prevous lectures, we troduced some basc probablty, the Cheroff boud, the coupo collector

More information

Lecture Notes Types of economic variables

Lecture Notes Types of economic variables Lecture Notes 3 1. Types of ecoomc varables () Cotuous varable takes o a cotuum the sample space, such as all pots o a le or all real umbers Example: GDP, Polluto cocetrato, etc. () Dscrete varables fte

More information

Bayes (Naïve or not) Classifiers: Generative Approach

Bayes (Naïve or not) Classifiers: Generative Approach Logstc regresso Bayes (Naïve or ot) Classfers: Geeratve Approach What do we mea by Geeratve approach: Lear p(y), p(x y) ad the apply bayes rule to compute p(y x) for makg predctos Ths s essetally makg

More information

Hashing. Alexandra Stefan

Hashing. Alexandra Stefan Hashng Alexandra Stefan 1 Hash tables Tables Drect access table (or key-ndex table): key => ndex Hash table: key => hash value => ndex Man components Hash functon Collson resoluton Dfferent keys mapped

More information

Dimensionality Reduction and Learning

Dimensionality Reduction and Learning CMSC 35900 (Sprg 009) Large Scale Learg Lecture: 3 Dmesoalty Reducto ad Learg Istructors: Sham Kakade ad Greg Shakharovch L Supervsed Methods ad Dmesoalty Reducto The theme of these two lectures s that

More information

hp calculators HP 30S Statistics Averages and Standard Deviations Average and Standard Deviation Practice Finding Averages and Standard Deviations

hp calculators HP 30S Statistics Averages and Standard Deviations Average and Standard Deviation Practice Finding Averages and Standard Deviations HP 30S Statstcs Averages ad Stadard Devatos Average ad Stadard Devato Practce Fdg Averages ad Stadard Devatos HP 30S Statstcs Averages ad Stadard Devatos Average ad stadard devato The HP 30S provdes several

More information

CIS 800/002 The Algorithmic Foundations of Data Privacy October 13, Lecture 9. Database Update Algorithms: Multiplicative Weights

CIS 800/002 The Algorithmic Foundations of Data Privacy October 13, Lecture 9. Database Update Algorithms: Multiplicative Weights CIS 800/002 The Algorthmc Foudatos of Data Prvacy October 13, 2011 Lecturer: Aaro Roth Lecture 9 Scrbe: Aaro Roth Database Update Algorthms: Multplcatve Weghts We ll recall aga) some deftos from last tme:

More information

CS473-Algorithms I. Lecture 12b. Dynamic Tables. CS 473 Lecture X 1

CS473-Algorithms I. Lecture 12b. Dynamic Tables. CS 473 Lecture X 1 CS473-Algorthm I Lecture b Dyamc Table CS 473 Lecture X Why Dyamc Table? I ome applcato: We do't kow how may object wll be tored a table. We may allocate pace for a table But, later we may fd out that

More information

Statistics Descriptive and Inferential Statistics. Instructor: Daisuke Nagakura

Statistics Descriptive and Inferential Statistics. Instructor: Daisuke Nagakura Statstcs Descrptve ad Iferetal Statstcs Istructor: Dasuke Nagakura (agakura@z7.keo.jp) 1 Today s topc Today, I talk about two categores of statstcal aalyses, descrptve statstcs ad feretal statstcs, ad

More information

Lebesgue Measure of Generalized Cantor Set

Lebesgue Measure of Generalized Cantor Set Aals of Pure ad Appled Mathematcs Vol., No.,, -8 ISSN: -8X P), -888ole) Publshed o 8 May www.researchmathsc.org Aals of Lebesgue Measure of Geeralzed ator Set Md. Jahurul Islam ad Md. Shahdul Islam Departmet

More information

Mu Sequences/Series Solutions National Convention 2014

Mu Sequences/Series Solutions National Convention 2014 Mu Sequeces/Seres Solutos Natoal Coveto 04 C 6 E A 6C A 6 B B 7 A D 7 D C 7 A B 8 A B 8 A C 8 E 4 B 9 B 4 E 9 B 4 C 9 E C 0 A A 0 D B 0 C C Usg basc propertes of arthmetc sequeces, we fd a ad bm m We eed

More information

Ordinary Least Squares Regression. Simple Regression. Algebra and Assumptions.

Ordinary Least Squares Regression. Simple Regression. Algebra and Assumptions. Ordary Least Squares egresso. Smple egresso. Algebra ad Assumptos. I ths part of the course we are gog to study a techque for aalysg the lear relatoshp betwee two varables Y ad X. We have pars of observatos

More information

Lecture 3. Sampling, sampling distributions, and parameter estimation

Lecture 3. Sampling, sampling distributions, and parameter estimation Lecture 3 Samplg, samplg dstrbutos, ad parameter estmato Samplg Defto Populato s defed as the collecto of all the possble observatos of terest. The collecto of observatos we take from the populato s called

More information

MA 524 Homework 6 Solutions

MA 524 Homework 6 Solutions MA 524 Homework 6 Solutos. Sce S(, s the umber of ways to partto [] to k oempty blocks, ad c(, s the umber of ways to partto to k oempty blocks ad also the arrage each block to a cycle, we must have S(,

More information

1 Onto functions and bijections Applications to Counting

1 Onto functions and bijections Applications to Counting 1 Oto fuctos ad bectos Applcatos to Coutg Now we move o to a ew topc. Defto 1.1 (Surecto. A fucto f : A B s sad to be surectve or oto f for each b B there s some a A so that f(a B. What are examples of

More information

A tighter lower bound on the circuit size of the hardest Boolean functions

A tighter lower bound on the circuit size of the hardest Boolean functions Electroc Colloquum o Computatoal Complexty, Report No. 86 2011) A tghter lower boud o the crcut sze of the hardest Boolea fuctos Masak Yamamoto Abstract I [IPL2005], Fradse ad Mlterse mproved bouds o the

More information

Mean is only appropriate for interval or ratio scales, not ordinal or nominal.

Mean is only appropriate for interval or ratio scales, not ordinal or nominal. Mea Same as ordary average Sum all the data values ad dvde by the sample sze. x = ( x + x +... + x Usg summato otato, we wrte ths as x = x = x = = ) x Mea s oly approprate for terval or rato scales, ot

More information

Class 13,14 June 17, 19, 2015

Class 13,14 June 17, 19, 2015 Class 3,4 Jue 7, 9, 05 Pla for Class3,4:. Samplg dstrbuto of sample mea. The Cetral Lmt Theorem (CLT). Cofdece terval for ukow mea.. Samplg Dstrbuto for Sample mea. Methods used are based o CLT ( Cetral

More information

22 Nonparametric Methods.

22 Nonparametric Methods. 22 oparametrc Methods. I parametrc models oe assumes apror that the dstrbutos have a specfc form wth oe or more ukow parameters ad oe tres to fd the best or atleast reasoably effcet procedures that aswer

More information

Lecture 7. Confidence Intervals and Hypothesis Tests in the Simple CLR Model

Lecture 7. Confidence Intervals and Hypothesis Tests in the Simple CLR Model Lecture 7. Cofdece Itervals ad Hypothess Tests the Smple CLR Model I lecture 6 we troduced the Classcal Lear Regresso (CLR) model that s the radom expermet of whch the data Y,,, K, are the outcomes. The

More information

Exchangeable Sequences, Laws of Large Numbers, and the Mortgage Crisis.

Exchangeable Sequences, Laws of Large Numbers, and the Mortgage Crisis. Exchageable Sequeces, Laws of Large Numbers, ad the Mortgage Crss. Myug Joo Sog Advsor: Prof. Ja Madel May 2009 Itroducto The law of large umbers for..d. sequece gves covergece of sample meas to a costat,.e.,

More information

ρ < 1 be five real numbers. The

ρ < 1 be five real numbers. The Lecture o BST 63: Statstcal Theory I Ku Zhag, /0/006 Revew for the prevous lecture Deftos: covarace, correlato Examples: How to calculate covarace ad correlato Theorems: propertes of correlato ad covarace

More information

Parameter, Statistic and Random Samples

Parameter, Statistic and Random Samples Parameter, Statstc ad Radom Samples A parameter s a umber that descrbes the populato. It s a fxed umber, but practce we do ot kow ts value. A statstc s a fucto of the sample data,.e., t s a quatty whose

More information

Analyzing Control Structures

Analyzing Control Structures Aalyzg Cotrol Strutures sequeg P, P : two fragmets of a algo. t, t : the tme they tae the tme requred to ompute P ;P s t t Θmaxt,t For loops for to m do P t: the tme requred to ompute P total tme requred

More information

11. Hash Tables. m is not too large. Many applications require a dynamic set that supports only the directory operations INSERT, SEARCH and DELETE.

11. Hash Tables. m is not too large. Many applications require a dynamic set that supports only the directory operations INSERT, SEARCH and DELETE. 11. Hash Tables May applicatios require a dyamic set that supports oly the directory operatios INSERT, SEARCH ad DELETE. A hash table is a geeralizatio of the simpler otio of a ordiary array. Directly

More information

Exercises for Square-Congruence Modulo n ver 11

Exercises for Square-Congruence Modulo n ver 11 Exercses for Square-Cogruece Modulo ver Let ad ab,.. Mark True or False. a. 3S 30 b. 3S 90 c. 3S 3 d. 3S 4 e. 4S f. 5S g. 0S 55 h. 8S 57. 9S 58 j. S 76 k. 6S 304 l. 47S 5347. Fd the equvalece classes duced

More information

Rademacher Complexity. Examples

Rademacher Complexity. Examples Algorthmc Foudatos of Learg Lecture 3 Rademacher Complexty. Examples Lecturer: Patrck Rebesch Verso: October 16th 018 3.1 Itroducto I the last lecture we troduced the oto of Rademacher complexty ad showed

More information

Unsupervised Learning and Other Neural Networks

Unsupervised Learning and Other Neural Networks CSE 53 Soft Computg NOT PART OF THE FINAL Usupervsed Learg ad Other Neural Networs Itroducto Mture Destes ad Idetfablty ML Estmates Applcato to Normal Mtures Other Neural Networs Itroducto Prevously, all

More information

Descriptive Statistics

Descriptive Statistics Page Techcal Math II Descrptve Statstcs Descrptve Statstcs Descrptve statstcs s the body of methods used to represet ad summarze sets of data. A descrpto of how a set of measuremets (for eample, people

More information

Lecture 1. (Part II) The number of ways of partitioning n distinct objects into k distinct groups containing n 1,

Lecture 1. (Part II) The number of ways of partitioning n distinct objects into k distinct groups containing n 1, Lecture (Part II) Materals Covered Ths Lecture: Chapter 2 (2.6 --- 2.0) The umber of ways of parttog dstct obects to dstct groups cotag, 2,, obects, respectvely, where each obect appears exactly oe group

More information

To use adaptive cluster sampling we must first make some definitions of the sampling universe:

To use adaptive cluster sampling we must first make some definitions of the sampling universe: 8.3 ADAPTIVE SAMPLING Most of the methods dscussed samplg theory are lmted to samplg desgs hch the selecto of the samples ca be doe before the survey, so that oe of the decsos about samplg deped ay ay

More information

ENGI 4421 Joint Probability Distributions Page Joint Probability Distributions [Navidi sections 2.5 and 2.6; Devore sections

ENGI 4421 Joint Probability Distributions Page Joint Probability Distributions [Navidi sections 2.5 and 2.6; Devore sections ENGI 441 Jot Probablty Dstrbutos Page 7-01 Jot Probablty Dstrbutos [Navd sectos.5 ad.6; Devore sectos 5.1-5.] The jot probablty mass fucto of two dscrete radom quattes, s, P ad p x y x y The margal probablty

More information

EECE 301 Signals & Systems

EECE 301 Signals & Systems EECE 01 Sgals & Systems Prof. Mark Fowler Note Set #9 Computg D-T Covoluto Readg Assgmet: Secto. of Kame ad Heck 1/ Course Flow Dagram The arrows here show coceptual flow betwee deas. Note the parallel

More information

STATISTICAL PROPERTIES OF LEAST SQUARES ESTIMATORS. x, where. = y - ˆ " 1

STATISTICAL PROPERTIES OF LEAST SQUARES ESTIMATORS. x, where. = y - ˆ  1 STATISTICAL PROPERTIES OF LEAST SQUARES ESTIMATORS Recall Assumpto E(Y x) η 0 + η x (lear codtoal mea fucto) Data (x, y ), (x 2, y 2 ),, (x, y ) Least squares estmator ˆ E (Y x) ˆ " 0 + ˆ " x, where ˆ

More information

Estimation of Stress- Strength Reliability model using finite mixture of exponential distributions

Estimation of Stress- Strength Reliability model using finite mixture of exponential distributions Iteratoal Joural of Computatoal Egeerg Research Vol, 0 Issue, Estmato of Stress- Stregth Relablty model usg fte mxture of expoetal dstrbutos K.Sadhya, T.S.Umamaheswar Departmet of Mathematcs, Lal Bhadur

More information

D KL (P Q) := p i ln p i q i

D KL (P Q) := p i ln p i q i Cheroff-Bouds 1 The Geeral Boud Let P 1,, m ) ad Q q 1,, q m ) be two dstrbutos o m elemets, e,, q 0, for 1,, m, ad m 1 m 1 q 1 The Kullback-Lebler dvergece or relatve etroy of P ad Q s defed as m D KL

More information

AN UPPER BOUND FOR THE PERMANENT VERSUS DETERMINANT PROBLEM BRUNO GRENET

AN UPPER BOUND FOR THE PERMANENT VERSUS DETERMINANT PROBLEM BRUNO GRENET AN UPPER BOUND FOR THE PERMANENT VERSUS DETERMINANT PROBLEM BRUNO GRENET Abstract. The Permaet versus Determat problem s the followg: Gve a matrx X of determates over a feld of characterstc dfferet from

More information

ECON 482 / WH Hong The Simple Regression Model 1. Definition of the Simple Regression Model

ECON 482 / WH Hong The Simple Regression Model 1. Definition of the Simple Regression Model ECON 48 / WH Hog The Smple Regresso Model. Defto of the Smple Regresso Model Smple Regresso Model Expla varable y terms of varable x y = β + β x+ u y : depedet varable, explaed varable, respose varable,

More information

Feature Selection: Part 2. 1 Greedy Algorithms (continued from the last lecture)

Feature Selection: Part 2. 1 Greedy Algorithms (continued from the last lecture) CSE 546: Mache Learg Lecture 6 Feature Selecto: Part 2 Istructor: Sham Kakade Greedy Algorthms (cotued from the last lecture) There are varety of greedy algorthms ad umerous amg covetos for these algorthms.

More information

1. A real number x is represented approximately by , and we are told that the relative error is 0.1 %. What is x? Note: There are two answers.

1. A real number x is represented approximately by , and we are told that the relative error is 0.1 %. What is x? Note: There are two answers. PROBLEMS A real umber s represeted appromately by 63, ad we are told that the relatve error s % What s? Note: There are two aswers Ht : Recall that % relatve error s What s the relatve error volved roudg

More information

UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS

UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS Exam: ECON430 Statstcs Date of exam: Frday, December 8, 07 Grades are gve: Jauary 4, 08 Tme for exam: 0900 am 00 oo The problem set covers 5 pages Resources allowed:

More information

Bounds on the expected entropy and KL-divergence of sampled multinomial distributions. Brandon C. Roy

Bounds on the expected entropy and KL-divergence of sampled multinomial distributions. Brandon C. Roy Bouds o the expected etropy ad KL-dvergece of sampled multomal dstrbutos Brado C. Roy bcroy@meda.mt.edu Orgal: May 18, 2011 Revsed: Jue 6, 2011 Abstract Iformato theoretc quattes calculated from a sampled

More information

Non-uniform Turán-type problems

Non-uniform Turán-type problems Joural of Combatoral Theory, Seres A 111 2005 106 110 wwwelsevercomlocatecta No-uform Turá-type problems DhruvMubay 1, Y Zhao 2 Departmet of Mathematcs, Statstcs, ad Computer Scece, Uversty of Illos at

More information

Qualifying Exam Statistical Theory Problem Solutions August 2005

Qualifying Exam Statistical Theory Problem Solutions August 2005 Qualfyg Exam Statstcal Theory Problem Solutos August 5. Let X, X,..., X be d uform U(,),

More information

Random Variables and Probability Distributions

Random Variables and Probability Distributions Radom Varables ad Probablty Dstrbutos * If X : S R s a dscrete radom varable wth rage {x, x, x 3,. } the r = P (X = xr ) = * Let X : S R be a dscrete radom varable wth rage {x, x, x 3,.}.If x r P(X = x

More information

Analysis of Variance with Weibull Data

Analysis of Variance with Weibull Data Aalyss of Varace wth Webull Data Lahaa Watthaacheewaul Abstract I statstcal data aalyss by aalyss of varace, the usual basc assumptos are that the model s addtve ad the errors are radomly, depedetly, ad

More information

1 Solution to Problem 6.40

1 Solution to Problem 6.40 1 Soluto to Problem 6.40 (a We wll wrte T τ (X 1,...,X where the X s are..d. wth PDF f(x µ, σ 1 ( x µ σ g, σ where the locato parameter µ s ay real umber ad the scale parameter σ s > 0. Lettg Z X µ σ we

More information

EP2200 Queueing theory and teletraffic systems. Queueing networks. Viktoria Fodor KTH EES/LCN KTH EES/LCN

EP2200 Queueing theory and teletraffic systems. Queueing networks. Viktoria Fodor KTH EES/LCN KTH EES/LCN EP2200 Queueg theory ad teletraffc systems Queueg etworks Vktora Fodor Ope ad closed queug etworks Queug etwork: etwork of queug systems E.g. data packets traversg the etwork from router to router Ope

More information