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 February of 2021 (the great cold storm of the century happened during this month!!!) as measured by the Accuweather site:

https://www.accuweather.com/en/us/durant/74701/february-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 February 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(14,8,7,5) represents, and then evaluate it.

Part 2

The following is the nutritional information for a 1 cup serving of pecans:


Express the total number of calories from a 1 cup serving of pecans 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 1 cup of pecans, compute the total number of calories in a 2.5 cup serving.

Part 4

How many servings can you have if you are allowed a 500 calorie snack?

Problem 3

The following table gives the total number of people fully vaccinated in Oklahoma over a window of time in April of 2021:

({{Day (in April),  People Fully Vaccinated }, {1, 1243871}, {2, 1268778}, {3, 1290295}, {4, 1307768}, {5, 1315073}, {6, 1318146}, {7, 1335798}, {8, 1351773}, {9, 1368221}, {10, 1386123}, {14, 1417964}, {15, 1428544}, {16, 1438343}, {17, 1447491}})

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 April 11th-13th.  Use the data from April 10th and 14th to extrapolate the total number of people vaccinated on each of the missing dates.

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 number of people fully vaccinated at the end of the days April 11th, 12th, and 13th were 1,402,339, 1,410,306, and 1,414,279, respectively.  Compute the difference between the actual values and the values you estimated in Part 2.  Explain your results.

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 estimates and the actual data from Part 4.  How far off, relatively, are your estimates?

Part 6

Plot the correct data values which were given in Part 4 for April 11th-13th, 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 circle of radius 4 centered at (1, 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 (1, 2).

Problem 5

Remember that a number is prime if and only if it is divisible only by itself and by 1.  Mathematica has a built in command to determine if a number is prime, it is called PrimeQ.  Also, if a number is not prime, we call it composite, and the FactorInteger command can tell us what its factors are!

PrimeQ[21847109]

PrimeQ[21847111]

FactorInteger[21847111]

11*13*152777

Part 1

Create a list which contains the first 10,000 prime numbers, storing it in the variable named PrimeList.

Part 2

Sum the entries of PrimeList