<snapdata remixID="10048286"><project name="U5L3pp3-5-Data-Processing (solution)" app="Snap! 6, https://snap.berkeley.edu" version="1"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAADOUlEQVR4Xu3XQUpjYRCF0V9RcOIW3I8bEHSgBtyJ28kmsh5x4iQEB6/BWQ+U5nLpAjkZp6rIeR88crZt27Z8CAwJnAlwSN7ZLwEBCmFUQICj/I4LUAOjAgIc5XdcgBoYFRDgKL/jAtTAqIAAR/kdF6AGRgUEOMrvuAA1MCogwFF+xwWogVEBAY7yOy5ADYwKCHCU33EBamBUQICj/I4LUAOjAgIc5XdcgBoYFRDgKL/jAtTAqIAAR/kdF6AGRgUEOMrvuAA1MCogwFF+xwWogVEBAY7yOy5ADYwKCHCU33EBamBUQICj/I4LUAOjAgIc5XdcgBoYFRDgKL/jAtTAqIAAR/kdF6AGRgUEOMrvuAA1MCogwFF+xwWogVEBAY7yOy5ADYwKCHCU33EBamBUQICj/I4LUAOjAgIc5XdcgBoYFRDgKL/jAtTAqIAAv+Hf7/fr/f193d7erpubm9GH9JuPC/Cbp/vx8bFeXl7W5+fnent7W/f39+vi4mI9PT2tq6ur39zEf/1tAvyB+3A4rNfX13V9ff3Xt47H43p+fl7btn2F6ZMLCDAI8HQ6rcfHx3V+fr7u7u5yfZNLgP/4Cn54ePh6Be92u3V5eSmdkoAA/QkppZStEWDmZqokIMASpDWZgAAzN1MlAQGWIK3JBASYuZkqCQiwBGlNJiDAzM1USUCAJUhrMgEBZm6mSgICLEFakwkIMHMzVRIQYAnSmkxAgJmbqZKAAEuQ1mQCAszcTJUEBFiCtCYTEGDmZqokIMASpDWZgAAzN1MlAQGWIK3JBASYuZkqCQiwBGlNJiDAzM1USUCAJUhrMgEBZm6mSgICLEFakwkIMHMzVRIQYAnSmkxAgJmbqZKAAEuQ1mQCAszcTJUEBFiCtCYTEGDmZqokIMASpDWZgAAzN1MlAQGWIK3JBASYuZkqCQiwBGlNJiDAzM1USUCAJUhrMgEBZm6mSgICLEFakwkIMHMzVRIQYAnSmkxAgJmbqZKAAEuQ1mQCAszcTJUEBFiCtCYTEGDmZqokIMASpDWZgAAzN1MlAQGWIK3JBASYuZkqCQiwBGlNJiDAzM1USUCAJUhrMgEBZm6mSgJ/AE38F7dMeMlrAAAAAElFTkSuQmCC</thumbnail><stage name="Stage" width="480" height="360" costume="0" color="255,255,255,1" tempo="60" threadsafe="false" penlog="false" volume="100" pan="0" lines="round" ternary="false" hyperops="true" codify="false" inheritance="true" sublistIDs="false" scheduled="false" id="1"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAOhUlEQVR4Xu3VwQkAAAjEMN1/abewn7jAQRC64wgQIECAAIF3gX1fNEiAAAECBAiMAHsCAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQIHLFxAWmhEwHPAAAAAElFTkSuQmCC</pentrails><costumes><list struct="atomic" id="2"></list></costumes><sounds><list struct="atomic" id="3"></list></sounds><variables></variables><blocks></blocks><scripts></scripts><sprites><sprite name="Sprite" idx="1" x="0" y="0" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="80,80,80,1" pen="tip" id="8"><costumes><list struct="atomic" id="9"></list></costumes><sounds><list struct="atomic" id="10"></list></sounds><blocks></blocks><variables></variables><scripts><script x="16" y="10"><custom-block s="headings of table %l"><l/><comment w="210.66666666666666" collapsed="true">U5L3 page 3 FYTD 7&#xD;(This is the first one that actually asks students to do something other than explore.)</comment></custom-block></script><script x="18" y="30"><custom-block s="data of table %l"><l/></custom-block></script><script x="18" y="53"><custom-block s="record %n of table %l"><l></l><l/><comment w="53.333333333333336" collapsed="true">5.3.3.8</comment></custom-block></script><script x="17" y="77"><custom-block s="field %n of record %l"><l></l><l/><comment w="371.3333333333333" collapsed="true">It&apos;s worth noting that the two selectors above have exactly the same code inside.</comment></custom-block></script><script x="18" y="103"><custom-block s="column %n of table %l"><l></l><l/><comment w="220" collapsed="true">5.3.3.9&#xD;This one is different; the code is simple once written, but may take some thought to write, especially if the students don&apos;t remember MAP.</comment></custom-block></script><script x="17" y="130"><custom-block s="average of list %l"><custom-block s="column %n of table %l"><l>9</l><custom-block s="data of table %l"><block var="cars"/></custom-block><comment w="62.666666666666664" collapsed="true">5.3.3.10</comment></custom-block></custom-block></script><script x="21" y="165.83333333333292"><block s="reportCombine"><custom-block s="column %n of table %l"><l>16</l><custom-block s="data of table %l"><block var="cars"/></custom-block></custom-block><block s="reifyReporter"><autolambda><custom-block s="minimum of %n %n"><l></l><l></l></custom-block></autolambda><list></list></block></block></script><script x="20" y="223.6666666666664"><block s="reportListLength"><block s="reportKeep"><block s="reifyPredicate"><autolambda><block s="reportEquals"><l></l><l>Manual transmission</l></block></autolambda><list></list></block><custom-block s="column %n of table %l"><l>12</l><custom-block s="data of table %l"><block var="cars"/></custom-block></custom-block></block><comment w="396" collapsed="true">These code examples correspond to the questions in the &quot;click for example questions&quot; hint box on the page.  The two LENGTH OF expressions above are equivalent ways to compute the answer to the third question.  Students may find other solutions, may ask different questions, and may even choose a different data set.</comment></block></script><script x="18.1865234375" y="287.4999999999999"><block s="reportListLength"><block s="reportKeep"><block s="reifyPredicate"><autolambda><block s="reportEquals"><custom-block s="field %n of record %l"><l>12</l><l/></custom-block><l>Manual transmission</l></block></autolambda><list></list></block><custom-block s="data of table %l"><block var="cars"/></custom-block><comment w="384.6666666666667" collapsed="true">5.3.3.11&#xD;Student answers will vary.  Sticking with data about cars, the first likely problem is to collect data in a uniform format. You&apos;d either try to find someone at the manufacturer to answer your questions, or (more likely these days) scrape their web pages.  But consider, for example, something as seemingly straightforward as the exterior car length.  Some manufacturers consider a sedan and a hatchback to be two variants of the same model, and so the web site may say something like &quot;138-142 inches&quot; as the reported car length.  That field isn&apos;t a number, so if you try to find the average length you&apos;ll get an error from the + function.  Similarly, one site might report city mpg and highway mpg as separate fields, while another site might have a single mpg entry of the form &quot;18/26&quot; with both city and highway mpg.  Another problem is that some sites will consider the unit of measure to be part of the value (&quot;length: 142 inches&quot;) while others will consider the unit of measure to be part of the label (&quot;length (inches): 142&quot;).&#xD;&#xD;A different kind of problem is trying to ensure the honesty of reported data; a recent example in the world of cars was the Volkswagen (and other companies) diesel scandal when it came to light that their engines included software that detected when the car was having an emissions test, and only then reduced emissions at the cost of decreased performance.  On the road, these diesel cars were very polluting.&#xD;&#xD;A third problem is to ensure that all sources of data are really reporting the same measure.  Currently, as we write these solutions in 2020, states are reporting COVID-19 deaths to the CDC, but it turned out that some states included all hospital deaths of COVID-19 patients, while other states included only deaths in which the immediate cause of death was the virus.  Neither is dishonest, but they&apos;re not comparable.  It&apos;s not obvious which is the better measure, because the virus exacerbates other issues such as blood pressure; if the virus raises a patient&apos;s already high blood pressure, and then the patient dies of a heart attack, is that a virus death?  (Some states have started reporting both numbers, for clarity.)&#xD;&#xD;If your data come from a telephone or Internet survey, it&apos;s very likely that there will be sample bias because whether someone agrees to participate in a survey is correlated with many other characteristics that might be relevant to your study.  Also, people sometimes lie, especially about sensitive issues such as HIV status. </comment></block></block></script><script x="20" y="359.16666666666663"><custom-block s="row with maximum in column %n between row %l and row %l"><l></l><l/><l/><comment w="90" collapsed="true">5.3.3 TIF A</comment></custom-block></script><script x="16" y="384.1666666666665"><custom-block s="row with maximum in column %n of table %l"><l></l><l/><comment w="399.3333333333333" collapsed="true">A common mistake will be to report the maximum value, rather than report the entire row containing the maximum value.  This will happen if students try to use the MAXIMUM block directly in the code, rather than using it as a model of how to build this block.</comment></custom-block></script><script x="18" y="412.1666666666664"><custom-block s="field %n of record %l"><l>13</l><custom-block s="row with maximum in column %n of table %l"><l>9</l><custom-block s="data of table %l"><block var="cars"/></custom-block></custom-block><comment w="397.3333333333333" collapsed="true">What makes this a TIF is that the field students are asked to REPORT (manufacturer, model, and year in field 13) is different from the field they are asked to MAXIMIZE (city mpg in field 9 or highway mpg in field 11).  That&apos;s why their ROW WITH MAXIMUM block has to report the entire record with the largest mpg, rather than merely report the largest mpg itself. </comment></custom-block></script><script x="21" y="460.99999999999966"><custom-block s="field named %s from record %l of table %l"><l></l><l/><l/><comment w="72" collapsed="true">5.3.3 TIF B</comment></custom-block></script><script x="22" y="485.1666666666662"><custom-block s="column named %s of table %l"><l></l><l/><comment w="398.6666666666667" collapsed="true">U5L3 page 4, FYTD 3.&#xD;Students pick their own question.  Shown below is the code for the two example questions in the hinted yellow box:</comment></custom-block></script><script x="22" y="510.99999999999966"><custom-block s="average of list %l"><custom-block s="column %n of table %l"><l>9</l><block s="reportKeep"><block s="reifyPredicate"><autolambda><block s="reportEquals"><custom-block s="field %n of record %l"><l>14</l><l/></custom-block><l>Volvo</l></block></autolambda><list></list></block><custom-block s="data of table %l"><block var="cars"/></custom-block></block></custom-block></custom-block></script><script x="18" y="587.8333333333329"><custom-block s="minimum of list %l"><custom-block s="column %n of table %l"><l>16</l><block s="reportKeep"><block s="reifyPredicate"><autolambda><block s="reportEquals"><custom-block s="field %n of record %l"><l>14</l><l/></custom-block><l>Honda</l></block></autolambda><list></list></block><custom-block s="data of table %l"><block var="cars"/></custom-block></block></custom-block><comment w="416.6666666666667" collapsed="true">5.3.4.4:  Student questions will vary.  Example: &quot;Does any car in the database have a highway MPG greater than 40?&quot; </comment></custom-block></script><script x="10" y="714.3333333333327"><block s="reportIsA"><block s="reportFindFirst"><block s="reifyPredicate"><autolambda><block s="reportGreaterThan"><custom-block s="field %n of record %l"><l>11</l><l/></custom-block><l>40</l></block></autolambda><list></list></block><custom-block s="data of table %l"><block var="cars"/></custom-block></block><l><option>list</option></l></block></script><script x="21" y="687.3333333333325"><block var="cars"><comment w="410.6666666666667" collapsed="true">5.3.4.5:  Here&apos;s just a sketch of what to look for.  Our sample application is traffic reporting.&#xD;&#xD;What kinds of data and where from:  Car position reports from sensors on highways of toll payment devices  in cars, position reports from car GPS units, and accident reports from state highway authorities.&#xD;&#xD;How the application transforms the data:  Successive position reports about the same car are examined to see if the car is still on the same street or highway.  If so, the difference in position (road miles, not straight-line miles) divided by the difference in time is the car&apos;s speed.  Outliers are eliminated, because some cars may stop at a highway rest stop or may have a flat tire or other accident.  At this point, the data are anonymized and made available to clients for display. </comment></block></script><script x="13" y="784.8333333333327"><block s="reportListItem"><l>2</l><block s="reportFindFirst"><block s="reifyPredicate"><autolambda><block s="reportEquals"><block s="reportListItem"><l>1</l><l/></block><l>Toyota</l></block></autolambda><list></list></block><custom-block s="group table %l by field %n by intervals of: %n"><custom-block s="data of table %l"><block var="cars"/></custom-block><l>14</l><l></l></custom-block></block><comment w="405.3333333333333" collapsed="true">U5L3 page 5, FYTD 2.  Questions will vary.  Code for the example questions:</comment></block></script><script x="14" y="867.166666666666"><block s="reportListLength"><block s="reportKeep"><block s="reifyPredicate"><autolambda><block s="reportEquals"><block s="reportListItem"><l>14</l><l/></block><l>Toyota</l></block></autolambda><list></list></block><custom-block s="data of table %l"><block var="cars"/></custom-block></block><comment w="404" collapsed="true">Note: Grouping is not strictly necessary for the example above.  It could equally well be solved this way:</comment></block></script><script x="13" y="922.3333333333325"><block s="reportListItem"><l>1</l><block s="reportCombine"><custom-block s="group table %l by field %n by intervals of: %n"><custom-block s="data of table %l"><block var="cars"/></custom-block><l>14</l><l></l></custom-block><block s="reifyReporter"><autolambda><custom-block s="bigger group count of groups %l %l"><l/><l/></custom-block></autolambda><list></list></block></block><comment w="405.3333333333333" collapsed="true">The same will be true of most student-chosen questions.  The situation in which we really /need/ GROUP is looking at all the counts, as in the second example:</comment></block></script><script x="11" y="1006.9999999999989"><custom-block s="bigger group count of groups %l %l"><l/><l/><comment w="186.66666666666666" collapsed="true">Helper for the above computation.</comment></custom-block></script><script x="18" y="1032.9999999999986"><block s="reportListItem"><l>2</l><block s="reportFindFirst"><block s="reifyPredicate"><autolambda><block s="reportEquals"><block s="reportListItem"><l>1</l><l/></block><l>2010</l></block></autolambda><list></list></block><custom-block s="group table %l by field %n by intervals of: %n"><block s="reportListItem"><l>3</l><block s="reportFindFirst"><block s="reifyPredicate"><autolambda><block s="reportEquals"><block s="reportListItem"><l>1</l><l/></block><l>Hyundai</l></block></autolambda><list></list></block><custom-block s="group table %l by field %n by intervals of: %n"><custom-block s="data of table %l"><block var="cars"/></custom-block><l>14</l><l></l></custom-block></block></block><l>16</l><l></l></custom-block></block><comment w="444" collapsed="true">(Field 14 = brand; field 16 = year.)  In case you find it easier (some do, some don&apos;t), here&apos;s the same computation done with PIPE:</comment></block></script><script x="16" y="1197.8333333333303"><custom-block s="pipe %s $arrowRight %mult%repRing"><custom-block s="data of table %l"><block var="cars"/></custom-block><list><block s="reifyReporter"><autolambda><custom-block s="group table %l by field %n by intervals of: %n"><l/><l>14</l><l>0</l></custom-block></autolambda><list></list></block><block s="reifyReporter"><autolambda><block s="reportFindFirst"><block s="reifyPredicate"><autolambda><block s="reportEquals"><block s="reportListItem"><l>1</l><l/></block><l>Hyundai</l></block></autolambda><list></list></block><l/></block></autolambda><list></list></block><block s="reifyReporter"><autolambda><block s="reportListItem"><l>3</l><l/></block></autolambda><list></list></block><block s="reifyReporter"><autolambda><custom-block s="group table %l by field %n by intervals of: %n"><l/><l>16</l><l>0</l></custom-block></autolambda><list></list></block><block s="reifyReporter"><autolambda><block s="reportFindFirst"><block s="reifyPredicate"><autolambda><block s="reportEquals"><block s="reportListItem"><l>1</l><l/></block><l>2010</l></block></autolambda><list></list></block><l/></block></autolambda><list></list></block><block s="reifyReporter"><autolambda><block s="reportListItem"><l>2</l><l/></block></autolambda><list></list></block></list><comment w="429.3333333333333" collapsed="true">Whew!  This says: Group the CARS table by brand; find the Hyundai row in the GROUP result; take the subtable (of CARS) with Hyundais from item 3 of the Hyundai GROUP; group that subtable by year; find the 2010 models in the GROUP result; get the count from item 2 of that GROUP row.  This is a good example to illustrate what&apos;s in column 3 of the GROUP result, but of course the question can be answered more easily:</comment></custom-block></script><script x="17" y="1366.3333333333298"><block s="reportListLength"><block s="reportKeep"><block s="reifyPredicate"><autolambda><block s="reportAnd"><block s="reportEquals"><block s="reportListItem"><l>14</l><l/></block><l>Hyundai</l></block><block s="reportEquals"><block s="reportListItem"><l>16</l><l/></block><l>2010</l></block></block></autolambda><list></list></block><custom-block s="data of table %l"><block var="cars"/></custom-block></block><comment w="426.6666666666667" collapsed="true">Where grouping really shines is in plotting the results; BAR GRAPH uses GROUP in its definition.</comment></block></script><script x="17" y="1457.9999999999964"><custom-block s="Comment5353"><comment w="425.3333333333333" collapsed="true">5.3.5.3:&#xD;(a) The mode is in the range (24-27].  (The asymmetric brackets mean that the exact value 27 is included, but the exact value 24 is not.  &quot;The range is open on the left and closed on the right.&quot;)&#xD;(b) The mode is in the range (18-24].&#xD;(c) Students may guess the problem is about the endpoints of the range, but it isn&apos;t.  If they plot a bar graph with an interval of 1 they&apos;ll find that the &quot;real&quot; mode is 25, so it&apos;s plot (b) that&apos;s anomalous.  The reason is that in the interval (18-24] all six bars have height over 200, whereas in (24-30] only four bars are over 200, so the /total/ number of cars in the former interval is greater than the total number in the latter, even though the tallest single bar, at 25, is in the latter.  This really does happen in statistical work, although in this tiny data set we had to work to find an example.&#xD;(d) Graphing with an interval of 1 works in this example, with a small range of possible values, all of which are integers.  But in cases where arbitrary real numbers are possible data, there may not be a &quot;real&quot; mode; each value may occur only once.  Worse, if each value occurs only once except for one value that, by coincidence, appears twice, reporting that value as a mode will convey the impression of a significant cluster that isn&apos;t really in the data.  If there&apos;s a very wide range of possible values, using an interval of 1 will result in an impossible-to-read wide graph that might hide a genuinely modal cluster of values that would be apparent in a graph with wider intervals.  (Of course, these days, statisticians don&apos;t eyeball physical graphs to find clusters; computer software does the clustering automatically to find genuine modes.)</comment></custom-block></script></scripts></sprite></sprites></stage><hidden></hidden><headers></headers><code></code><blocks><block-definition s="headings of table %&apos;table&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportListItem"><l>1</l><block var="table"/></block></block></script></block-definition><block-definition s="data of table %&apos;table&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportCDR"><block var="table"/></block></block></script></block-definition><block-definition s="record %&apos;index&apos; of table %&apos;table&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%l"></input></inputs><script><block s="doReport"><block s="reportListItem"><block var="index"/><block var="table"/></block></block></script></block-definition><block-definition s="field %&apos;index&apos; of record %&apos;record&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%l"></input></inputs><script><block s="doReport"><block s="reportListItem"><block var="index"/><block var="record"/></block></block></script></block-definition><block-definition s="column %&apos;index&apos; of table %&apos;table&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%l"></input></inputs><script><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportListItem"><block var="index"/><l/></block></autolambda><list></list></block><block var="table"/></block></block></script></block-definition><block-definition s="average of list %&apos;data&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportQuotient"><block s="reportCombine"><block var="data"/><block s="reifyReporter"><autolambda><block s="reportSum"><l></l><l></l></block></autolambda><list></list></block></block><block s="reportListLength"><block var="data"/></block></block></block></script></block-definition><block-definition s="minimum of %&apos;a&apos; %&apos;b&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="reportIfElse"><block s="reportLessThan"><block var="a"/><block var="b"/></block><block var="a"/><block var="b"/></block></block></script></block-definition><block-definition s="maximum of %&apos;a&apos; %&apos;b&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%n"></input></inputs><script><block s="doReport"><block s="reportIfElse"><block s="reportGreaterThan"><block var="a"/><block var="b"/></block><block var="a"/><block var="b"/></block></block></script></block-definition><block-definition s="row with maximum in column %&apos;col&apos; between row %&apos;rowA&apos; and row %&apos;rowB&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%l"></input><input type="%l"></input></inputs><script><block s="doReport"><block s="reportIfElse"><block s="reportGreaterThan"><custom-block s="field %n of record %l"><block var="col"/><block var="rowA"/></custom-block><custom-block s="field %n of record %l"><block var="col"/><block var="rowB"/></custom-block></block><block var="rowA"/><block var="rowB"/></block></block></script></block-definition><block-definition s="row with maximum in column %&apos;col&apos; of table %&apos;table&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%n"></input><input type="%l"></input></inputs><script><block s="doReport"><block s="reportCombine"><block var="table"/><block s="reifyReporter"><autolambda><custom-block s="row with maximum in column %n between row %l and row %l"><block var="col"/><l/><l/></custom-block></autolambda><list></list></block></block></block></script></block-definition><block-definition s="minimum of list %&apos;data&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportCombine"><block var="data"/><block s="reifyReporter"><autolambda><custom-block s="minimum of %n %n"><l></l><l></l></custom-block></autolambda><list></list></block></block></block></script></block-definition><block-definition s="maximum of list %&apos;data&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportCombine"><block var="data"/><block s="reifyReporter"><autolambda><custom-block s="maximum of %n %n"><l></l><l></l></custom-block></autolambda><list></list></block></block></block></script></block-definition><block-definition s="sum of list %&apos;data&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportCombine"><block var="data"/><block s="reifyReporter"><autolambda><block s="reportSum"><l></l><l></l></block></autolambda><list></list></block></block></block></script></block-definition><block-definition s="bar chart of table %&apos;data&apos; $nl grouped by field: %&apos;field&apos; from: %&apos;floor&apos; to: %&apos;ceiling&apos; interval: %&apos;interval&apos;" type="reporter" category="lists"><comment x="0" y="0" w="344.6666666666667" collapsed="false">Takes a table (typically from a CSV data set) as input and reports a summary of the table grouped by the field in the specified column number.  The remaining three inputs are used only if the field values are numbers, in which case they can be grouped into buckets (e.g., decades, centuries, etc.).  Those three inputs specify the smallest and largest values of interest and, most importantly, the width of a bucket (10 for decades, 100 for centuries).  If the field isn&apos;t numeric, leave these three inputs empty or set them to zero.  In that case, each string value of the field is its own bucket, and they appear sorted alphabetically.&#xD;&#xD;The block reports a new table with three columns.  The first column contains the bucket name or smallest number.  The second column contains a nonnegative integer that says how many records in the input table fall into this bucket.  The third column is a subtable containing the actual records from the original table that fall into the bucket.&#xD;&#xD;If your buckets aren&apos;t of constant width, or you want to group by some function of more than one field, load the &quot;Frequency Distribution Analysis&quot; library instead. </comment><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%n"></input><input type="%n"></input><input type="%n"></input><input type="%n"></input></inputs><script><block s="doDeclareVariables"><list><l>sorted</l></list></block><block s="doSetVar"><l>sorted</l><custom-block s="sort table %l on field %n in %s order"><custom-block s="group table %l by field %n by intervals of: %n"><block var="data"/><block var="field"/><block var="interval"/></custom-block><l>1</l><l>ascending</l></custom-block></block><block s="doIf"><block s="reportEquals"><block var="interval"/><l>0</l></block><script><block s="doReport"><block var="sorted"/></block></script></block><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportCONS"><block s="reportProduct"><block s="reportListItem"><l>1</l><l/></block><block var="interval"/></block><block s="reportCDR"><l/></block></block></autolambda><list></list></block><custom-block s="bar chart helper function to fill %l key: %repRing %br from: %n to: %n interval: %repRing with: %repRing"><block var="sorted"/><block s="reifyReporter"><autolambda><block s="reportListItem"><l>1</l><l/></block></autolambda><list></list></block><block s="reportMonadic"><l><option>ceiling</option></l><block s="reportQuotient"><block var="floor"/><block var="interval"/></block></block><block s="reportMonadic"><l><option>ceiling</option></l><block s="reportQuotient"><block var="ceiling"/><block var="interval"/></block></block><block s="reifyReporter"><autolambda><block s="reportSum"><l></l><l>1</l></block></autolambda><list></list></block><block s="reifyReporter"><autolambda><block s="reportNewList"><list><l></l><l>0</l><block s="reportNewList"><list></list></block></list></block></autolambda><list></list></block></custom-block></block></block></script></block-definition><block-definition s="bar chart helper function to fill %&apos;data&apos; key: %&apos;key&apos; $nl from: %&apos;floor&apos; to: %&apos;ceiling&apos; interval: %&apos;interval&apos; with: %&apos;generator&apos;" type="reporter" category="lists"><comment x="0" y="0" w="103" collapsed="false">add missing entries to a sorted list. Used for histograms</comment><header></header><code></code><translations>pt:os itens de _ com a chave _ entre _ e _ com passo _ completados por _&#xD;</translations><inputs><input type="%l"></input><input type="%repRing"></input><input type="%n"></input><input type="%n"></input><input type="%repRing"></input><input type="%repRing"></input></inputs><script><block s="doIf"><block s="reportGreaterThan"><block var="floor"/><block var="ceiling"/></block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script></block><block s="doIf"><block s="reportEquals"><block var="data"/><block s="reportNewList"><list></list></block></block><script><block s="doReport"><block s="reportCONS"><block s="evaluate"><block var="generator"/><list><block var="floor"/></list></block><custom-block s="bar chart helper function to fill %l key: %repRing %br from: %n to: %n interval: %repRing with: %repRing"><block var="data"/><block var="key"/><block s="evaluate"><block var="interval"/><list><block var="floor"/></list></block><block var="ceiling"/><block var="interval"/><block var="generator"/></custom-block></block></block></script></block><block s="doIf"><block s="reportLessThan"><block s="evaluate"><block var="key"/><list><block s="reportListItem"><l>1</l><block var="data"/></block></list></block><block var="floor"/></block><script><block s="doReport"><custom-block s="bar chart helper function to fill %l key: %repRing %br from: %n to: %n interval: %repRing with: %repRing"><block s="reportCDR"><block var="data"/></block><block var="key"/><block var="floor"/><block var="ceiling"/><block var="interval"/><block var="generator"/></custom-block></block></script></block><block s="doIf"><block s="reportEquals"><block s="evaluate"><block var="key"/><list><block s="reportListItem"><l>1</l><block var="data"/></block></list></block><block var="floor"/></block><script><block s="doReport"><block s="reportCONS"><block s="reportListItem"><l>1</l><block var="data"/></block><custom-block s="bar chart helper function to fill %l key: %repRing %br from: %n to: %n interval: %repRing with: %repRing"><block s="reportCDR"><block var="data"/></block><block var="key"/><block s="evaluate"><block var="interval"/><list><block var="floor"/></list></block><block var="ceiling"/><block var="interval"/><block var="generator"/></custom-block></block></block></script></block><block s="doReport"><block s="reportCONS"><block s="evaluate"><block var="generator"/><list><block var="floor"/></list></block><custom-block s="bar chart helper function to fill %l key: %repRing %br from: %n to: %n interval: %repRing with: %repRing"><block var="data"/><block var="key"/><block s="evaluate"><block var="interval"/><list><block var="floor"/></list></block><block var="ceiling"/><block var="interval"/><block var="generator"/></custom-block></block></block></script></block-definition><block-definition s="pipe %&apos;value&apos; $arrowRight %&apos;pipe&apos;" type="reporter" category="control"><header></header><code></code><translations>pt:a aplicação a _ de _&#xD;</translations><inputs><input type="%s"></input><input type="%mult%repRing"></input></inputs><script><block s="doIf"><block s="reportListIsEmpty"><block var="pipe"/></block><script><block s="doReport"><block var="value"/></block></script></block><block s="doReport"><custom-block s="pipe %s $arrowRight %mult%repRing"><block s="evaluate"><block s="reportListItem"><l>1</l><block var="pipe"/></block><list><block var="value"/></list></block><block s="reportCDR"><block var="pipe"/></block></custom-block></block></script></block-definition><block-definition s="plot bar chart %&apos;data&apos; $nl bars at x: %&apos;left&apos; y: %&apos;bottom&apos; width: %&apos;width&apos; height: %&apos;height&apos;" type="command" category="pen"><header></header><code></code><translations>pt:desenha gráfico de barras de _ em (x: _ , y: _ ) com largura _ e altura _&#xD;</translations><inputs><input type="%l"></input><input type="%n">-200</input><input type="%n">-100</input><input type="%n">400</input><input type="%n">200</input></inputs><script><block s="doDeclareVariables"><list><l>ratio</l><l>step</l><l>flat line ends</l><l>col</l><l>sorted</l><l>min</l><l>digit12</l><l>saved pentrails</l><l>digit10</l><l>x label width</l><l>saved position</l><l>label delta y</l><l>max y</l></list></block><block s="doSetVar"><l>flat line ends</l><block s="reportGlobalFlag"><l><option>flat line ends</option></l></block></block><block s="doSetGlobalFlag"><l><option>flat line ends</option></l><l><bool>true</bool></l></block><block s="doSetVar"><l>saved pentrails</l><block s="reportPenTrailsAsCostume"></block></block><block s="clear"></block><block s="up"><comment w="105.33333333333333" collapsed="false">find out how wide a digit is at two sizes</comment></block><block s="doGotoObject"><l><option>center</option></l></block><block s="write"><l>1234567890</l><l>12</l></block><block s="doSetVar"><l>digit12</l><block s="reportQuotient"><block s="xPosition"></block><l>10</l></block></block><block s="clear"></block><block s="up"></block><block s="doGotoObject"><l><option>center</option></l></block><block s="write"><l>1234567890</l><l>10</l></block><block s="doSetVar"><l>digit10</l><block s="reportQuotient"><block s="xPosition"></block><l>10</l></block></block><block s="clear"></block><block s="doSwitchToCostume"><block var="saved pentrails"/></block><block s="doStamp"></block><block s="clear"><comment w="237.33333333333334" collapsed="false">added because plotting two graphs superimposed doesn&apos;t really work anyway.</comment></block><block s="doSwitchToCostume"><l><option>Turtle</option></l></block><block s="doSetVar"><l>x label width</l><block s="reportMonadic"><l><option>ceiling</option></l><block s="reportMonadic"><l><option>log</option></l><block s="reportListItem"><l>1</l><block s="reportListItem"><l><option>last</option></l><block var="data"/></block></block></block></block></block><block s="doSetVar"><l>sorted</l><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportListItem"><l>2</l><l/></block></autolambda><list></list></block><custom-block s="sort table %l on field %n in %s order"><block var="data"/><l>2</l><l>descending</l></custom-block></block></block><block s="doIfElse"><block s="reportLessThan"><block s="reportListItem"><l><option>last</option></l><block var="sorted"/></block><l>0</l></block><script><block s="doSetVar"><l>min</l><block s="reportListItem"><l><option>last</option></l><block var="sorted"/></block></block></script><script><block s="doSetVar"><l>min</l><l>0</l></block></script><comment w="142" collapsed="false">If smallest value &lt; 0, the x axis isn&apos;t at the bottom.&#xD;Note that sort is by &gt; not by &lt;.&#xD;Not clear this can happen in a&#xD;histogram!</comment></block><block s="doSetVar"><l>max y</l><block s="reportListItem"><l>1</l><block var="sorted"/></block></block><block s="doSetVar"><l>ratio</l><block s="reportQuotient"><block var="height"/><block s="reportDifference"><block s="reportListItem"><l>1</l><block var="sorted"/></block><block var="min"/></block></block></block><block s="doSetVar"><l>label delta y</l><block s="reportProduct"><block s="reportRound"><block s="reportQuotient"><block var="max y"/><l>50</l></block></block><l>10</l></block></block><block s="doSetVar"><l>step</l><block s="reportQuotient"><block var="width"/><block s="reportListLength"><block var="data"/></block></block></block><block s="doIfElse"><block s="reportGreaterThan"><block var="step"/><l>2</l></block><script><block s="doSetVar"><l>col</l><block s="reportDifference"><block var="step"/><l>1</l></block></block></script><script><block s="doSetVar"><l>col</l><block s="reportProduct"><block var="step"/><l>0.8</l></block></block></script></block><block s="gotoXY"><block var="left"/><block s="reportDifference"><block var="bottom"/><block s="reportProduct"><block var="min"/><block var="ratio"/></block></block></block><block s="setSize"><l>1</l></block><block s="down"></block><block s="setHeading"><l>90</l></block><block s="forward"><block var="width"/><comment w="110.66666666666667" collapsed="true">draw x axis at y=0</comment></block><block s="up"></block><block s="gotoXY"><block var="left"/><block var="bottom"/></block><block s="setHeading"><l>0</l></block><block s="down"></block><block s="forward"><block var="height"/><comment w="74.66666666666667" collapsed="true">draw y axis</comment></block><block s="up"></block><block s="setHeading"><l>90</l></block><block s="gotoXY"><block s="reportDifference"><block var="left"/><block s="reportSum"><block var="digit12"/><l>2</l></block></block><block s="reportDifference"><block var="bottom"/><block s="reportProduct"><block var="min"/><block var="ratio"/></block></block></block><block s="write"><l>0</l><l>12</l></block><block s="doFor"><l>i</l><l>1</l><l>5</l><script><block s="changeYPosition"><block s="reportProduct"><block s="reportDifference"><block var="label delta y"/><block var="min"/></block><block var="ratio"/></block></block><block s="setXPosition"><block s="reportDifference"><block var="left"/><block s="reportSum"><block s="reportProduct"><block var="digit12"/><block s="reportStringSize"><block s="reportProduct"><block var="label delta y"/><block var="i"/></block></block></block><l>2</l></block></block></block><block s="write"><block s="reportProduct"><block var="label delta y"/><block var="i"/></block><l>12</l></block></script></block><block s="gotoXY"><block var="left"/><block var="bottom"/><comment w="112" collapsed="true">Ready to draw bars.</comment></block><block s="changeXPosition"><block s="reportQuotient"><block var="step"/><l>2</l></block></block><block s="setSize"><block var="col"/></block><block s="doWarp"><script><block s="doUntil"><block s="reportEquals"><block s="reportListLength"><block var="data"/></block><l>0</l></block><script><block s="down"></block><block s="changeYPosition"><block s="reportProduct"><block s="reportDifference"><block s="reportListItem"><l>2</l><block s="reportListItem"><l>1</l><block var="data"/></block></block><block var="min"/></block><block var="ratio"/></block></block><block s="up"></block><block s="setYPosition"><block var="bottom"/></block><block s="doSetVar"><l>saved position</l><block s="reportNewList"><list><block s="xPosition"></block><block s="yPosition"></block></list></block></block><block s="doIfElse"><block s="reportLessThan"><block var="col"/><l>15</l><comment w="319.3333333333333" collapsed="true">Choose label format depending on label width vs. bar width.</comment></block><script><block s="setYPosition"><block s="reportDifference"><block var="bottom"/><l>2</l></block></block><block s="changeXPosition"><block s="reportDifference"><block s="reportQuotient"><block var="step"/><l>2</l></block><l>8</l></block></block><block s="setHeading"><l>180</l></block><block s="write"><block s="reportListItem"><l>1</l><block s="reportListItem"><l>1</l><block var="data"/></block></block><l>10</l></block></script><script><block s="doIfElse"><block s="reportLessThan"><block var="col"/><block s="reportProduct"><block s="reportProduct"><block var="digit10"/><block var="x label width"/></block><l>2.5</l></block></block><script><block s="setYPosition"><block s="reportDifference"><block var="bottom"/><l>2</l></block></block><block s="changeXPosition"><block s="reportDifference"><block s="reportQuotient"><block var="step"/><l>2</l></block><l>10</l></block></block><block s="setHeading"><l>180</l></block><block s="write"><block s="reportListItem"><l>1</l><block s="reportListItem"><l>1</l><block var="data"/></block></block><l>12</l></block></script><script><block s="doIfElse"><block s="reportLessThan"><block var="col"/><block s="reportProduct"><block s="reportProduct"><block var="digit12"/><block var="x label width"/></block><l>2.5</l></block></block><script><block s="setYPosition"><block s="reportDifference"><block var="bottom"/><l>10</l></block></block><block s="setHeading"><l>90</l></block><block s="forward"><block s="reportDifference"><block s="reportDifference"><block s="reportQuotient"><block var="step"/><l>2</l></block><block s="reportProduct"><block var="digit10"/><block s="reportMonadic"><l><option>ceiling</option></l><block s="reportMonadic"><l><option>log</option></l><block s="reportListItem"><l>1</l><block s="reportListItem"><l>1</l><block var="data"/></block></block></block></block></block></block><l>2</l></block></block><block s="write"><block s="reportListItem"><l>1</l><block s="reportListItem"><l>1</l><block var="data"/></block></block><l>10</l></block></script><script><block s="setYPosition"><block s="reportDifference"><block var="bottom"/><l>12</l></block></block><block s="setHeading"><l>90</l></block><block s="forward"><block s="reportDifference"><block s="reportDifference"><block s="reportQuotient"><block var="step"/><l>2</l></block><block s="reportProduct"><block var="digit12"/><block s="reportMonadic"><l><option>ceiling</option></l><block s="reportMonadic"><l><option>log</option></l><block s="reportListItem"><l>1</l><block s="reportListItem"><l>1</l><block var="data"/></block></block></block></block></block></block><l>2</l></block></block><block s="write"><block s="reportListItem"><l>1</l><block s="reportListItem"><l>1</l><block var="data"/></block></block><l>12</l></block></script></block></script></block></script></block><block s="doSetVar"><l>data</l><block s="reportCDR"><block var="data"/></block></block><block s="setHeading"><l>90</l></block><block s="doGotoObject"><block var="saved position"/></block><block s="changeXPosition"><block var="step"/></block></script></block></script></block><block s="doSetGlobalFlag"><l><option>flat line ends</option></l><block var="flat line ends"/></block></script></block-definition><block-definition s="sort table %&apos;data&apos; on field %&apos;field number&apos; in %&apos;order&apos; order" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%n"></input><input type="%s" readonly="true"><options>ascending&#xD;descending</options></input></inputs><script><block s="doIfElse"><block s="reportEquals"><block var="order"/><l>ascending</l></block><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>data</l><l>fn</l><l>proc</l></list><l>return proc.reportAtomicSort(data, fn);</l></block><list><block var="data"/><block s="reifyPredicate"><autolambda><block s="reportLessThan"><block s="reportListItem"><block var="field number"/><l/></block><block s="reportListItem"><block var="field number"/><l/></block></block></autolambda><list></list></block></list></block></block></script><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>data</l><l>fn</l><l>proc</l></list><l>return proc.reportAtomicSort(data, fn);</l></block><list><block var="data"/><block s="reifyPredicate"><autolambda><block s="reportGreaterThan"><block s="reportListItem"><block var="field number"/><l/></block><block s="reportListItem"><block var="field number"/><l/></block></block></autolambda><list></list></block></list></block></block></script></block></script></block-definition><block-definition s="group table %&apos;data&apos; by field %&apos;number&apos; by intervals of: %&apos;interval&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%n"></input><input type="%n"></input></inputs><script><block s="doIf"><block s="reportEquals"><block var="interval"/><l>0</l></block><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>data</l><l>fn</l><l>proc</l></list><l>return proc.reportAtomicGroup(data, fn);</l></block><list><block var="data"/><block s="reifyReporter"><autolambda><block s="reportListItem"><block var="number"/><l/></block></autolambda><list></list></block></list></block></block></script></block><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>data</l><l>fn</l><l>proc</l></list><l>return proc.reportAtomicGroup(data, fn);</l></block><list><block var="data"/><block s="reifyReporter"><autolambda><block s="reportMonadic"><l><option>ceiling</option></l><block s="reportQuotient"><block s="reportListItem"><block var="number"/><l/></block><block var="interval"/></block></block></autolambda><list></list></block></list></block></block></script></block-definition><block-definition s="field named %&apos;name&apos; from record %&apos;record&apos; of table %&apos;table&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%l"></input><input type="%l"></input></inputs><script><block s="doReport"><block s="reportListItem"><custom-block s="index of %s in %l"><block var="name"/><custom-block s="headings of table %l"><block var="table"/></custom-block></custom-block><block var="record"/></block></block></script></block-definition><block-definition s="index of %&apos;thing&apos; in %&apos;data&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%l"></input></inputs><script><block s="doDeclareVariables"><list><l>index</l></list></block><block s="doSetVar"><l>index</l><l>0</l></block><block s="doForEach"><l>item</l><block var="data"/><script><block s="doChangeVar"><l>index</l><l>1</l></block><block s="doIf"><block s="reportEquals"><block var="item"/><block var="thing"/></block><script><block s="doReport"><block var="index"/></block></script></block></script></block><block s="doReport"><l>0</l></block></script></block-definition><block-definition s="column named %&apos;name&apos; of table %&apos;table&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%s"></input><input type="%l"></input></inputs><script><block s="doReport"><custom-block s="column %n of table %l"><custom-block s="index of %s in %l"><block var="name"/><custom-block s="headings of table %l"><block var="table"/></custom-block></custom-block><custom-block s="data of table %l"><block var="table"/></custom-block></custom-block></block></script><scripts><comment x="13.333333333333334" y="138.13333333333333" w="410" collapsed="false">Alternate solution below is also okay, but slower because it finds the name in the header repeatedly for each record in the table.</comment><script x="14.333333333333334" y="197.13333333333333"><block s="doReport"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="field named %s from record %l of table %l"><block var="name"/><l/><block var="table"/></custom-block></autolambda><list></list></block><custom-block s="data of table %l"><block var="table"/></custom-block></block></block></script></scripts></block-definition><block-definition s="bigger group count of groups %&apos;A&apos; %&apos;B&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input><input type="%l"></input></inputs><script><block s="doReport"><block s="reportIfElse"><block s="reportGreaterThan"><block s="reportListItem"><l>2</l><block var="A"/></block><block s="reportListItem"><l>2</l><block var="B"/></block></block><block var="A"/><block var="B"/></block></block></script></block-definition><block-definition s="Comment5353" type="reporter" category="other"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doReport"><l></l></block></script></block-definition><block-definition s="ExportBlocks" type="command" category="other"><header></header><code></code><translations></translations><inputs></inputs></block-definition></blocks><variables></variables></project><media name="U5L3pp3-5-Data-Processing (solution)" app="Snap! 6, https://snap.berkeley.edu" version="1"></media></snapdata>