# Stem-and-leaf graph

#math-shit

A stem-and-leaf graph, also called a stemplot, is a way to represent
the distribution of numeric data. It was invented by John Tukey, a
mathematician, and is a quick way to picture data for numbers that are
greater than 0. I'll explain using an example.

Suppose you have the following set of numbers (they might represent
the number of home runs hit by a major league baseball player during
his career).

32, 33, 21, 45, 58, 20, 33, 44, 28, 15, 18, 25

The stem of a stemplot can have as many digits as needed, but the
leaves should contain only one digit. To create a stemplot to display
the above data, you must first create the stem. Since all of the
numbers have just two digits, start by arranging the tens digits from
smallest to largest.

To create the leaves, draw a vertical bar after each of the tens
digits and arrange the ones digits from each number in the data set in
order from smallest to largest. If there are duplicate numbers, like
33, list each one.

1|58
2|0158
3|233
4|45
5|8

The shape of the resulting display looks something like a bar graph
oriented vertically. By examining the stemplot, you can determine
certain properties of the data.

You can find the median by counting from either end of the stemplot
until you find its center. Here, since there are 12 numbers, the
center lies between 28 and 32. The median is the average of the two
data points: (28+32)/2 = 30.)

You can also determine if there is a mode in the data set by looking
at the plot. Here, the number 33 is the mode since it is the only
value that occurs more than once.

If your data contain three digit numbers (like batting averages, for
example), you can use the same technique. For example, let's assume
the data are

298, 303, 285, 311, 225, 315, 250, 305

Ignore the ones digits in each number (these will be the leaves) and
look at the remaining two digits in each number (the hundreds and tens
digits). The stem will begin at 22 because the smallest number in the
data set is 225. The stem will end at 31 because the largest number is
315. Include the two-digit numbers between 22 and 31 in the body of
the stem.

Once you have the stem, then list the ones digits in each number after
the corresponding two-digit number before it. The stemplot will look
like this, with no leaves after the numbers without a corresponding
value.

22|5
23|
24|
25|0
26|
27|
28|5
29|8
30|35
31|15

If these data represent the batting averages for a particular player,
this display indicates that he has had a very successful career - most
of his averages are clustered between 280 and 320.