Math 1483 - Quiz 2

YOUR NAME HERE

Remember, ALT+7 gives a new text cell, be sure to explain your answers, if needed!

Problem 1

Your task for this problem will involve visualizing weather data

Part 1

Examine the weather data for Durant, OK over the month of August,  2021 as measured by the Accuweather site:

https://www.accuweather.com/en/us/durant/74701/august-weather/335176?year=2021

Store the data in two separate data sets:
(1) The first data set being ordered pairs consisting of the day of the month and the day’s high temperature.
(2) The second data set being ordered pairs consisting of the day of the month and the day’s low temperature.
Give each data set an appropriate name.

Part 2

Create a plot of each of the data sets.  Your plot should include the following:
(1) Make sure the symbols for each set is distinct.
(2) Colour the high temp data set red.
(3) Colour the low temp data set blue.
(4) Add legends for each data set.
(5) Add the appropriate labels to both axes.
(6) Connect the points in each data set by lines. (Hint: This is an option in the ListPlot command)

Part 3

Compute the average and median for the daily low temp data set.

Part 4

Compute the average and median for the daily high temp data set.

Part 5

Construct a data set which is the difference between the daily high temp and daily low temp

Part 6

Plot the difference data set along with the two data sets from Part 2, be sure to use a different colour for the new data set, and add a plot legend for it.

Part 7

On what days in August were there the largest and smallest changes in daily temperature?

Problem 2

A common formula used for counting calories of a food consumed is given by:

TotCal(P,F,C,D) = 4P+9F+4(C-D)

Where T is the total number of calories, P is the number of grams of protein, F is the number of grams of fat, C the total number of grams carbohydrate, and D the number of grams of dietary fiber.

We define the function with the following command.  Be sure to execute it!

TotCal[P_,F_,C_,D_]:=4*P+9*F+4*(C-D)

Part 1

Explain what TotCal(24,12,15,3) represents, and then evaluate it.

Part 2

The following is the nutritional information for 2 fried catfish filets:


Express the total number of calories from a 2 filet (strips) serving of fried catfish in function notation using the function TotCal(P,F,C,D) .

Part 3

Using your answer from Part 2, and being honest with yourself that you could not simply eat 2 fried catfish filets, this is Oklahoma after all! Compute the total number of calories in a 7 fried catfish filets.

Problem 3

The following table gives the number of people vaccinated per 100 in Oklahoma over a window of time in July of 2021:

({{Day (in July),  People Vaccinated Per 100}, {1, 44.91}, {2, 45.00}, {3, 45.07}, {4, 45.14}, {5,  }, {6, 45.20}, {7, 45.23}, {8, 45.30}, {9,  }, {10, 45.49}, {11, 45.59}, {12, 45.65}, {13, 45.69}, {14, 45.77}})

Go here for covid state data: https://github.com/owid/covid-19-data/tree/master/public/data/vaccinations

Part 1

Plot the data given in the table above.  Be sure to label your axes appropriately.

Part 2

You will notice that data is missing for the dates of July 5th and July 9th.  For July 5th, use the data from July 4th and July 6th to extrapolate the number of people vaccinated per 100. Perform a similar extrapolation for July 9th using July 8th and July 10th.

Part 3

Plot the missing data you computed along with the data from part 1.  Be sure to use a different symbol and colour for the missing data.

Part 4

The data for July 10th is actually missing, however the data for July 10th is known to be 45.39 people per 100.  Compute the difference between  the extrapolated value and the true value.  Was the extrapolation an underestimate or an overestimate?

Part 5

The differences you computed in Part 4 give you the amount the approximations were off, however they lack context.  A better way to look at these differences is in terms of relative differences.  A relative difference is is the difference divided by the correct value, which gives us a percentage.  For instance, if a value is known to be 142, and we estimate it to be 128, the difference is:

Part 5

The differences you computed in Part 4 give you the amount the approximations were off, however they lack context.  A better way to look at these differences is in terms of relative differences.  A relative difference is is the difference divided by the correct value, which gives us a percentage.  For instance, if a value is known to be 142, and we estimate it to be 128, the difference is:

142-128

While the relative difference is:

(142-128)/142.0

This tells us that the relative difference is 0.985, or approximately a 9.85% deviation. 

Compute the relative differences between your estimate and the actual data from Part 4.  How far off, relatively, was your extrapolation?

Part 6

Plot the correct data value which was given in Part 4 for July 9th, along with the two data sets you plotted in Part 3.  Once again, be sure to use a new symbol and colour!

Problem 4

Using the Graphics command to draw a blue disk of radius 1 centered at (2, 1), a green triangle with vertices at (-1, 2), (2, 1), and (1, -2) on the same graph, and your name in magenta coloured text at the point (0.5, 0.5).

Problem 5

A perfect number is a positive integer that is equal to the sum of its equal divisors.  Mathematica has a built in command to determine if a number is perfect, it is called PerfectNumberQ.  We can also use FactorInteger to verify if a number is perfect or not.

PerfectNumberQ[20]

Divisors[20]

Total[%]-20

PerfectNumberQ[28]

Divisors[28]

Total[%]-28

Notice that for n=20, its proper divisors are 1, 2, 4, 5, and 10, which sums to 22.  On the other hand, n=28 has proper divisors 1, 2, 4, 7, and 14, which do sum to 28.

Part 1

Create a list which contains the first 10 perfect numbers (there are only 51 known so far!), storing it in the variable named PerfectList.

Part 2

Sum the entries of PerfectList