Changes to Problems 1-2

I changed the number of samples from "n*2" to "n" for options 4 and 5,
when we're sampling from multivariate normal distributions. The reason
for this is because multivariate normal random samples are vectors equal
to the number of parameters (in this case 2), so by multiplying it by 2
we were getting twice as many observations as we wanted.
I also changed the way we sampled for option=5; the old way might have
been mixing up results from different columns of the multivariate
distribution.
Finally, I changed the output of the function from have five different
potential outputs (e.g. voter1, voter2, etc.) to all be labeled "voter";
I don't think this should cause any problems since we're only generating
one matrix at a time.
Updated Problem 3

Had a problem with the following line of code in problem 3:
apply((voter.position - party.1)^2, 1, sum)

I'm not sure this was working correctly. When I tried subtracting
voter.position and party.1, it would subtract it in the reverse order
that we wanted. (i.e. instead of subtracting the two values of party.1
across the rows like we wanted, it was subtracting down the columns...so
the first column of voter.positions was sometimes having the first value
of party.1 being subtracted from it, and other times it was having the
second value of party.1 being subtracted from it.)

To be safe I decided to calculate the difference in positions as a
matrix first, then go through and add them up. This may have been
unnecessary, in which case I'm sorry for making the code more complex. I
can try and describe in better detail what I think was wrong with the
old code if you want, just let me know.
Minor edits to Problems 1:3; Problem 4 finished

Title says it all; fixed a bug in problem 1 I missed. Reran code.
Problem 4 written so it works with my rewrite of problem 3; I didn't end
up using ggplot because I didn't even notice that code until after I
finished, but let me know if either of you really want this done via
ggplot and I'll happily do it.
Initial Attempt at Problem 5

Not quite done yet; still need to make a few changes, but I should have
the "master" function described in the homework done soon. At the moment
the main problem seems to be that my visualization2 function is
recalculating the voter preferences when I run it through the for loop.
I need to go back and change how this function (and affiliation2) work
so that they do not create new preferences every time.