Homework 5. Deadline: Monday, January 9. ================= 1. Exercises 7.7 and 7.8 from the book. Ex. 7.7: Write a Prolog program that defines the predicate random_pick, for which the goal random_pick(L,E) instantiates E to a randomly chosen element of list L. Hint: Use the random number generator and define a predicate that returns the Nth element of a list. Ex. 7.8: Given the goal findall(X,G,L), what happens when there are uninstantiated variables not sharing with X in G? ----------------- 2. Solve the following puzzle (from Edi Weitz). Three mice are living next to each other in three holes in the wall. Each mouse has a favorite cheese flavor and a favorite TV show. Here are the hints: 1. Mice: Mickey, Mighty and Minny. 2. Cheese: Gouda, Emmentaler, Brie. 3. Shows: Emergency Room, Seinfeld, Simpsons. 4. Mickey Mouse loves Gouda. 5. Mighty Mouse's favorite TV show is Emergency Room. 6. The mouse that lives in the left hole never misses an episode of Seinfeld. 7. Mickey Mouse and Mighty Mouse have one mouse hole between them. 8. The Simpsons fan does not live on the left of the Brie lover. For each mouse find the hole where it leaves, a favorite cheese and a favorite show. ==================