# How many tanks?

- Author:
- timteachesmath

What you want to do:
1) Put samples in brackets in column A. e.g., {37, 102, 138, 251, 17, 188, 196}
2) In column B, have the spreadsheet calculate your test statistic. Unlike Excel, you don't need an equals sign to start formulas. Some commands you might want to use are max[], min[], mean[], median[], mode[], q1[], q3[]. Inside the brackets, you want to put the cell you're referring to (e.g., 3*mean[A3]-max[A3}+5).
3) You can adjust the width of categories for the histogram by changing the value in cell B1.
4) When you're finished, inside the applet window go to File ... Export ... Graphics View as Picture. Change the resolution to 72 dpi, save it with the filename starting with 'war-', and upload your file to Wikispaces by clicking on 'Files and folders' first.

Here is how this document was set up:
In the input bar, I typed 'x=273' to get the vertical line.
To open the spreadsheet, I pressed Ctrl-Shift-S. In cell B2, I typed '25' which I'll use for the width of each category in my histogram.
The command 'sequence[273]' creates a list of numbers {1, 2, 3, . . . 273}.
In cell A3, I typed the command 'sample[sequence[273], 7]', which randomly chooses 7 elements from my sequence without replacement. I don't think this command is available in Excel.
The sequence command also makes more complicated sequences if I have more arguments. The syntax sequence[expression in terms of variable, the variable, first value the variable takes, last value the variable takes] works just like summation notation. For example, if I want the list {0, 25, 50, 75, ..., 600}, I'd enter 'sequence[25*t, t, 0, 24]'. This produces {25*0, 25*1, 25*2, ..., 25*24}.
To set up my histogram to by dynamically updated as I enter new data, I need to have something in my cells to start, so to prepare I typed '600' in cells B3 through B102.
The 'histogram' command takes several arguments: histogram[list of class boundaries, list of raw data, should I use a scale factor (true or false), and the scale factor (optional)].
I want my class boundaries to be the sample sequence above, but instead of using 25, I'll use the value typed in cell B1 so that users can change the value in B1 and the histogram will automatically update.
So, in the input bar, I typed 'h=Histogram[Sequence[B1 t, t, 0, ceil(600 / B1)], B3:B102, false]'.
The ceil() function just rounds the number 600/B1 up to the next integer, because I want a whole number of 'bars' in my histogram. Enjoy!