# What are the odds a graph generated “randomly” represents a function?

I'm creating an activity for my class that teaches the vertical and horizontal line tests and for the life of me I can't figure out the probabilities involved. Here's the exercise:

Draw 5 pairs of cards from a standard deck. Each pair defines a point in the plane: the first card is the x-coordinate of a point and the second card is the y-coordinate (Jacks = 11, Queens = 12, Kings = 13). Red cards are positive and black cards are negative. Plot the 5 points, shuffle the cards, repeat the process to get a total of 10 points.

Question: What are the odds your graph passes the vertical line test?

This isn't the question the students will be answering, they are just calculating the experimental probabilities by polling the class. I thought it would be cool to show them the theoretical odds so we could discuss how close we are, but so far I've only been able to find simple, easy-to-understand wrong answers. I imagine it's pretty likely I've just forgotten some combinatorics and this is actually pretty easy to figure out.

(Update: About 34% is the most sensible answer I've gotten so far.)

-
Why do you have red for positive and black for negative? That's opposite of the usual metaphors about bottom lines (based on obsolete mechanical calculators to be sure). – Henning Makholm Sep 16 '12 at 13:54
@Henning I think the practice of recording negative values in red is significantly older than the widespread use of mechanical calculators. I can find clear references to the practice in Google Book search results well back into the middle of the 19th century. – MJD Sep 17 '12 at 5:34
@Henning It was an arbitrary choice, but I went with the labeling of car battery terminals. The red one is positive and the black is negative. – Nathan St. John Sep 25 '12 at 17:22

## 1 Answer

This answer only gives bounds, not an exact value.

There will 45 pairs of pairs possible from any sequence of 10 pairs of cards.

For each of the 20 pairs of pairs that are not separated by the
mid-game shuffle, the probability that they give the same point is

$\frac{50}{51} \cdot \frac1{50} \cdot \frac1{49} \: = \: \frac1{2499} \: \approx \: 0.00040016 \;\;\;\;$.

For each of the 25 pairs of pairs that are separated by the
mid-game shuffle, the probability that they give the same point is

$\left(\frac{50}{51} \cdot \frac2{52} \cdot \frac2{51}\right) + \left(\frac1{51} \cdot \frac2{52} \cdot \frac1{51}\right) \: = \: \frac{101}{67626} \: \approx \: 0.0014935 \;\;$.

The probability that there is a pair of pairs that give the same point is at most

$\left(20\cdot \frac1{2499}\right) + \left(25\cdot \frac{101}{67626}\right) \: = \: \frac{150245}{3313674} \: \approx \: 0.04534 \;\;$.

Since it is possible for more than one pair of pairs to give the same point, the
probability that some pair of pairs that give the same point is less than $\frac{150245}{3313674}\:$.

It is possible that the points pass the vertical line test and some pair of pairs gives the same point.

The probability that the points pass the vertical line test and some pair
of pairs gives the same point is greater than 0 and less than $\frac{150245}{3313674}\:$.

$\frac{50\cdot 48\cdot 46\cdot 44\cdot 42\cdot 40\cdot 38\cdot 36\cdot 34}{51\cdot 50\cdot 49\cdot 48\cdot 52\cdot 51\cdot 50\cdot 49\cdot 48} \: = \: \frac{76912}{379015} \: \approx \: 0.2029260056$

$\frac{76912}{379015} + \frac{150245}{3313674} \: = \: \frac{28793647}{115978590} \: \approx \: 0.2482669172$

When $p$ is the probability that the graph passes the vertical line test,

$0.2029260056 \approx \frac{76912}{379015} < p < \frac{28793647}{115978590} \approx 0.2482669172 \;\;$.

-
25 of the 45 pairs of pairs will be separated by the mid-game shuffle, and then the probability of the same point can be up to $\frac{2}{52}\cdot \frac{2}{52}=\frac{1}{676}$. – Henning Makholm Sep 17 '12 at 9:23
fixed ${}{}{}\:$ – Ricky Demer Sep 17 '12 at 22:31