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 January of 2021 as measured by the Accuweather site:

https://www.accuweather.com/en/us/durant/74701/january-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 January 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 fiber, 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 ounce serving of walnuts:

Express the total number of calories from a 1 ounce serving of walnuts 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 ounce of walnuts, compute the total number of calories in a 3.5 ounce 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 vaccinated against Covid-19 in Oklahoma from January 12th to January 25th 2021. :

({{Day (in January), Total People Vaccinated }, {12, 109045}, {13, 118786}, {14, 160035}, {15, 173162}, {19, 209687}, {20, 217690}, {21, 230902}, {22, 247954}, {23, 263315}, {24, 279283}, {25, 282679}})

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 January 16th-18th.  Use the data from January 15th and 19th 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

Estimate the total number of people vaccinated on January 26th using the data points from January 24th and 25th.

Part 5

The actual value for the total number of people vaccinated up through January 26th is 284799.  Was your answer from Part 4 an overestimate or underestimate?

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