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", new Plural(function(num) { return $.ngettext("grocery store", "grocery stores", num); })], ["department store", new Plural(function(num) { return $.ngettext("department store", "department stores", num); })], ["zoo", new Plural(function(num) { return $.ngettext("zoo", "zoos", num); })] ]) { "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_form(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_form(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_form(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_form(ITEM) at a LOCATION_DISPLAY.

We can combine the tens and ones places and write out the number of plural_form(ITEM) at each LOCATION_DISPLAY 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_form(ITEM) at the different plural_form(LOCATION_DISPLAY):

\qquadtoSentenceTex( RAW_DATA )

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

\qquadtoSentenceTex( RAW_DATA, 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_DISPLAY with the fewest plural_form(ITEM) had SOLUTION ITEM. The LOCATION_DISPLAY with the fewest plural_form(ITEM) had SOLUTION plural_form(ITEM, SOLUTION). The LOCATION_DISPLAY with the most plural_form(ITEM) had SOLUTION ITEM. The LOCATION_DISPLAY with the most plural_form(ITEM) had SOLUTION plural_form(ITEM, SOLUTION). There are SOLUTION LOCATION_DISPLAY that match our question. There are SOLUTION plural_form(LOCATION_DISPLAY, SOLUTION) that match our question.

"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_form(LOCATION_DISPLAY) have exactly AMOUNT ITEM? How many plural_form(LOCATION_DISPLAY) have exactly AMOUNT plural_form(ITEM, AMOUNT)?

SOLUTION plural_form(LOCATION_DISPLAY)

"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_form(LOCATION_DISPLAY) have fewer than AMOUNT ITEM? How many plural_form(LOCATION_DISPLAY) have fewer than AMOUNT plural_form(ITEM, AMOUNT)?

SOLUTION plural_form(LOCATION_DISPLAY)

"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_form(LOCATION_DISPLAY) have more than AMOUNT ITEM? How many plural_form(LOCATION_DISPLAY) have more than AMOUNT plural_form(ITEM, AMOUNT)?

SOLUTION plural_form(LOCATION_DISPLAY)

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

What was the smallest number of plural_form(ITEM) at any one LOCATION_DISPLAY? What was the largest number of plural_form(ITEM) at any one LOCATION_DISPLAY?

SOLUTION plural_form(ITEM)