cs0931handinfall2015@gmail.com
. In the text file please label your answers clearly so that we know which answers go with which question.
In class, we built a spreadsheet that took all the voting records (+1 for Yea, -1 for Nay, 0 for missing, etc.) and compared them pairwise. The comparison used the idea that if you multiply two voting records and sum up the resulting products, you get the "agree minus disagree" number. (If you take absolute values before multiplying, you get "agree + disagree" instead). This notion of sums of pairwise products comes up over and over again in mathematics, economics, etc. It's almost never done with pairs of rows from a table, but instead with a row from one table and a column from another. When we do this, each table (which should be a table of numbers) is called a matrix (plural: matrices), and the process of computing all possible row-column sum-products is called "matrix multiplication." You're going to play with that a little bit in this problem.
A
, in pink, whose rows are labeled with the names of people, and whose columns are labeled with items for purchase. Robin is evidently planning to buy more stuff than Mary is.
You'll also see matrix B
, a table of prices (in dollars per item) for the three items, for each of two months.
Notice that the number of COLUMNS of A
is the same as the number of ROWS of B
.
A
*B
:
B12
through F16
: the first one to the left, the second one up and to the right. We then fill in the space (marked in green) in the lower right. Each cell in the green space lies in the same row as some row of matrix A
and in the same column as some column of matrix B
. We place in this cell the SUMPRODUCT
of that row and that column.
When you use SUMPRODUCT, you can pass either two rows or two columns. To have the function to work with a row and a column, use the TRANSPOSE function in one of the arguments, transforming a row into a column or a column into a row. Your function should look like:SUMPRODUCT("row", TRANSPOSE("column"))
SUMPRODUCT(TRANSPOSE("row"), "column")
SUMPRODUCT
formula you wrote wasn't too complex, but there's a far simpler way to produce the same answer.
E23
, the formula
= MMULT(something, something else)
where the "something" is the range that defines the pink matrix, and the "something else" is the range defining the blue matrix.
The results should be the same as those in the green area above.
MMULT
doesn't actually require that its two arguments (the things inside the parentheses) be placed in the way we placed them for the SUMPRODUCT
computation: they can be anywhere. You'll see that in E7
to F8
, we've made another green box. Enter a formula in E7
that will multiply the two original matrices (just to the left of the green box) and produce a result that should be the same as the one you got for the last two steps.
If we write the ROW labels for matrix A
and the COLUMN labels for matrix B
near our green matrix, the top left corner is "Robin, July"
. What does the number 20 that's in that spot mean? Well, it was computed as
(1 x 2) + (2 x 3) + (3 x 3)
so it's the total cost for Robin to buy her basket of goods in july: 1 soap at $2, 2 eggs at $3, and 3 pears at $4. (Expensive pears!)
Open the "Random Coin Flips" tab of the spreadsheet. Using the RANDBETWEEN()
function, we've made 25 rows of 8 random numbers each, representing coin-flips: 0 is heads, 1 is tails. You're going to make a summary of these results.
You might expect that if you flip a coin 8 times, on average it'll come up heads four times.
I
, a formula to compute how many heads you got in each 8-flip trial. It'd be best if you entered just one formula in cell I2
, and then filled down, of course. I
? (Hint: zero). The largest? Fill in your answers in the spaces provided.A31
, enter the word "Value", and beneath it enter a list of the possible values, from smallest to largest, starting with the smallest in cell A32.B31
, enter the label "Value Count", and in cell B32
, enter a formula to count how many times you got exactly zero heads in the 25 experiments. (For "0", use a reference to cell A32
). Fill that formula down, and see whether it gives you the counts of how many times you got 1, 2, 3, etc. heads. Hint: if you use =A32
as your condition in a COUNTIF
, it won't "fill" correctly, because the cell reference is inside a string, and gets ignored. If you just type A32
, it works fine, though.A31
to B40
(more or less), you've got some data. Try to figure out a way to make a graph of that data, with the "values" on the x-axis and the value-counts on the y-axis. It could be a line graph, or bar graph, or anything else. Some words are more common than others; a quick way to tell is to do a quick Google search. "Synchronicity" has about 5 million results, while "Diachronicity" has only about 9000.
Open a new tab on your spreadsheet, and in that tab, build a spreadsheet that lets a viewer enter two words and then shows which one has more results in a Google search.
To find the URL, you'll do a Google search for some word and see what the URL is, and then try to alter that to handle other words. If you go to google.com and type your query there, the URL of the results page should look like
https://www.google.com/search?q=synchronicity
But beware: if you type your query directly in the address bar (in Chrome), the resulting URL will look like this:
https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8
#safe=off&q=synchronicity
or possibly something even more complex.
Use the simpler form. Google Spreadsheets doesn't seem to be able to read from the more complicated URL for the results page.
Share the following spreadsheet with cs0931handinfall2015@gmail.com
FirstLast_HW1-5
In the above file name, "FirstLast" should be replaced with your first and last name. If it is not, we will take off points. Make sure every task has been completed.