randRange( 5, 7 ) randRange( 10, 20 ) randRange( 20, STEMS * 10 - 20 ) randRange( 10, 15 ) sortNumbers( $.map( _.range( SAMPLES ), function() { var dataPoint; while ( 1 ) { dataPoint = round( randGaussian() * TGT_STDDEV + TGT_MEAN ); if ( dataPoint >= 0 && dataPoint < STEMS * 10 ) { return dataPoint; } } }) ) $.map( _.range( STEMS ), function( stem ) { return [ $.map( RAW_DATA, function( leaf ) { if ( stem * 10 <= leaf && leaf < ( stem + 1 ) * 10 ) { return leaf - ( stem * 10 ); } }) ]; }) randFromArray([ "grocery store", "department store", "zoo" ]) { "grocery store": fruit(1), "department store": clothing(1), "zoo": animal(1) }[ LOCATION ]

{The buyer for|A statistician for|An executive of} a chain of supermarkets created the following stem-and-leaf plot showing the number of plural( ITEM ) at each of the stores:

{The buyer for|A statistician for|The regional manager of} a chain of department stores created the following stem-and-leaf plot showing the number of plural( ITEM ) at each of the stores:

{The government|A conservation group|A zookeeper} {created|published} the following stem-and-leaf plot showing the number of plural( ITEM ) at each major zoo in the country:

\left| \quad \begin{matrix} STEM \vphantom{\Large{0}} \\ \end{matrix} \quad \right| \quad \begin{matrix} LEAF& \vphantom{\Large{0}} \\ \end{matrix}

The left column of the stem and leaf plot represents the tens place; each number on the right side represents the ones place for the number of plural( ITEM ) at a LOCATION.

We can combine the tens and ones places and write out the number of plural( ITEM ) at each LOCATION on the right:

\small{ \left| \space \begin{matrix} \color{GREEN}{STEM} \vphantom{\Large{0}} \\ \end{matrix} \space \right| \space \begin{matrix} \color{BLUE}{LEAF}& \vphantom{\Large{0}} \\ \end{matrix} \space \begin{matrix} \rightarrow \vphantom{\Large{0}} \\ \end{matrix} \space \begin{matrix} \color{GREEN}{STEM}\color{BLUE}{LEAF}& \vphantom{\Large{0}} \\ \end{matrix} }

Now we know the number of plural( ITEM ) at the different plural( LOCATION ):

\qquadtoSentenceTex( RAW_DATA )

What was the fewest number of plural( ITEM ) at any one LOCATION? What was the largest number of plural( ITEM ) at any one LOCATION? How many plural( LOCATION ) have exactly fewer than more than plural( AMOUNT, ITEM )?

\qquadtoSentenceTex( RAW_DATA, "and", IS_SOLUTION, "hint_pink" )

\qquad \left| \quad \begin{matrix} STEM \vphantom{\Large{0}} \\ \end{matrix} \quad \right| \quad \begin{matrix} \color{PINK}{LEAF}& LEAF& \vphantom{\Large{0}} \\ \end{matrix}

The LOCATION with the fewest plural( ITEM ) had plural( SOLUTION, ITEM ). The LOCATION with the most plural( ITEM ) had plural( SOLUTION, ITEM). plural( SOLUTION, LOCATION ) plural( "has", "have", SOLUTION ) exactly fewer than more than plural( AMOUNT, ITEM ).

"how-many" random() < 0.7 ? randFromArray( RAW_DATA ) : round( randGaussian() * TGT_STDDEV + TGT_MEAN ) function( x ) { return x === AMOUNT; } _.reduce( RAW_DATA, function( memo, num ) { return num === AMOUNT ? ++memo : memo; }, 0 )

How many plural( LOCATION ) have exactly plural( AMOUNT, ITEM )?

SOLUTION plural( LOCATION )

"less-than" randRange( 10, (STEMS - 1) * 10 ) function( x ) { return x < AMOUNT; } _.reduce( RAW_DATA, function( memo, num ) { return num < AMOUNT ? ++memo : memo; }, 0 )

How many plural( LOCATION ) have fewer than plural( AMOUNT, ITEM )?

SOLUTION plural( LOCATION )

"greater-than" randRange( 10, (STEMS - 1) * 10 ) function( x ) { return x > AMOUNT; } _.reduce( RAW_DATA, function( memo, num ) { return num > AMOUNT ? ++memo : memo; }, 0 )

How many plural( LOCATION ) have more than plural( AMOUNT, ITEM )?

SOLUTION plural( LOCATION )

randFromArray([ "smallest", "largest" ]) TYPE === "smallest" ? RAW_DATA[ 0 ] : RAW_DATA[ RAW_DATA.length - 1 ] function( x ) { return x === AMOUNT; } AMOUNT

What was the fewest number of plural( ITEM ) at any one LOCATION? What was the largest number of plural( ITEM ) at any one LOCATION?

SOLUTION plural( ITEM )