COGSCI 131 – Assignment 6 DUE: March 12 at class start
In this problem set, we are going to implement an analysis along the lines of Shepard’s Universal Law of Generalization. Imagine that you have one-dimensional stimuli. You should first construct a set of 10,000 consequential regions by randomly (uniformly) selecting a start and end points in [-10,10]. It will be easiest if you store these consequential regions in a list [ (start1,end1), (start2,end2), … ]. As in class, assume that all of your consequential regions are equally likely.
1. [5pts, HELP] Write a function called contains that takes a region and checks if it contains a given point. You may find it helpful to use this function and python’s “list comprehensions” in order to answer questions in this assignment.
2. [10pts, HELP] What is the probability of getting x=1 for regions containing x=0? NOTE: this is not just one over the number of regions containing both 1 and 0 – that doesn’t take into account the fact that each region assigns x a different probability of occurring.
3. [20pts, SOLO] Plot the probability of getting x for x ranging from 0 to 10, for regions containing x=0. What does this function look like? Write a sentence explaining why intuitively.
4. [5pts, HELP] One way to check if the curve has an exponential decrease is to plot a logarithmic y axis and look for a straight line. Why does this check if the curve is exponential?
5. [10pts, SOLO] Plot Q3 with a logarithmic y axis for x ranging from -5 to 5, and x ranging from -10 to 10. What do these two plots show? How do you interpret them? Explain in a few sentences.
6. [10pts, SOLO] In previous questions, we’ve been assuming that people implement the law perfectly and we have been trying to approximate their behavior using 10,000 regions. However, people themselves have limited resources. What if people themselves only used a few consequential regions in order to compute generalizations? Re-plot Question 3 using only 10, 100, and 1000 consequential regions. What patterns do you see?
7. [10pts, HELP] Describe a way you could test how many consequential regions people actually made use of in this kind of generalization. Could you tell the difference between 10 and 10,000? Could you tell the difference between 10,000 and 20,000, why or why not?