10-5 notes - Exam Typed page for exam ASSUME o Average case...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Typed page for exam ASSUME o Average case analysis (not malicious adversary) (Uniformly distributed random inputs) o Simple uniform hashing For any given hash function, if given a key it will uniformly distribute throughout the table The cost (in collisions) of find () in a chained hash table with n keys = θ(n/m) Hash Function Choice o Output should be uniform on (o…m-1) o Avoid patters on typical inputs Idea #1 o Division Hashing H(k) = k mod m Diffusion o Used in Cryptographic Hashing o One change causes a huge change in output o Advice Use a odd prime number for m o Need good diffusion so you can protect yourself against stupidity Multiplicative hashing o Let A be a constant, 0<A<1 o H(k) = math.floor(m(KA-int(KA))) (KA-int(KA) Returns a number between [0…1) m(KA-int(KA) Returns a number between [0…m) math.floor(m(KA-int(KA))) returns a int inclusive [0…m-1] o Ideas: “A” should be irrational Between (1/2, 1)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

10-5 notes - Exam Typed page for exam ASSUME o Average case...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online