We covered Similarity Graphs today, which are on a Monday handout that I gave out in class. See the web site for information on similarity graphs and pattern recognition and S levels. Also did the mapping of PANTHERS letters to a hash table with f o g (l) where l is a letter from PANTHERS and g(l) is the ASCII value of the letter, and f(x) = x mod 9 The successful search value or average should come out to 11/8 or 1 3/8 and the unsuccessful to 45/9 or exactly 5. All you need to know is that the ASCII value of A = 65. Since 65 mod 9 = 2 or, 65 = 7 * 9 + 2 you do NOT need to know or look up ANY of the other ASCII values, if you proceed like this: 0 H Q Z and the range of the function f o g({P,A,N,T,H,E,R,S}) 1 I R ----- was {0, 1, 2, 3, 6, 8} 2 A J S 3 B K T which means it was not injective, 4 C L U since the cardinality of the 5 D M V domain = 8 and is greater than 6 E N W cardinality of range = 6. 7 F O X 8 G P Y Of course, it could never be onto (surjective), since cardinality of codomain = 9 and PANTHERS is only 8 letters. The codomain of the function f o g (l) is {0, 1, 2, 3, 4, 5, 6, 7, 8}, since the remainder when you divide by 9 will always be r >= 0 and r <= 8. Since the cardinality of the domain set (8 letters in PANTHERS here), is less than the cardinality of the codomain, we know that the RANGE of f o g({P, A, N, T, H, E, R, S}) will be ----- a PROPER SUBSET of the codomain { 0, 1, 2, 3, 4, 5, 6, 7, 8 }. Collision resolution is by linear probe method. 2 A J S Easily seen that the function f o g ("A") = f o g ("S"), so f o g(letters in Panthers) is NOT injective, i.e. not one-to-one. Note that "A" and "S" are synonyms with respect to function f o g()! -------- Thus ends the partial summary of Wednesday, December 8th class. --------------- Map the letters in DISCRETE into 8, 9, 10, 11, 12 and 13 locations. {D, I, S, C, R, E, T} is 7 distinct letters in the set. 0 H Q Z 1 I R <------------------ I and R 2 A J S <------------------ S 3 B K T <------------------ T 4 C L U <------------------ C 5 D M V <------------------ D Cardinality of the 6 E N W <------------------ E the RANGE for mod 9 7 F O X for DISCRET is 6. 8 G P Y Is the cardinality of the RANGE of DISCRET ever = 7 for mod 8, mod 10, mod 11, mod 12 or mod 13? Try it. What is the cardinality of the range for each mapping from mod 8 up to the mod 13 mapping? Good practice!!!! Mark