Math 1483 - Quiz 1

-=Solutions=-

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

Problem 1

In two different ways, use Mathematica  commands to determine which is larger: (100^99) or (99^100).

We can simply take the difference of the two.  Since the answer is negative, (99^100) is greater than (100^99).

100^99-99^100

We can simply ask Mathematica if (100^99)> (99^100), and the result is False.

100^99>99^100

Problem 2

Evaluate (Sqrt[(2/((3^3)-1))+5*((4^2)-(2^3))]) in the following two ways:

Part 1

Simplify the expression given in the problem, keeping your answer exact.

Sqrt[2/(3^3-1)+5*(4^2-2^3)]

Part 2

Numerically approximate the expression to 10 decimal places.

The numerical approximation to 10 decimal places (note that we need 11 as the optional argument for N[]) is:

N[Sqrt[2/(3^3-1)+5*(4^2-2^3)],11]

Problem 3

Let f(x) = (x^4)+3(x^3)-6(x^2)+2x-1, and g(x) = -2(x^4)+5(x^3)-11(x^2)+6x+1.

Part 1

Find ALL the values of x for which f(x) = g(x). Note there will be 4 solutions.

The four solutions are x=-(1/3), 1, i (Sqrt[2]), -i(Sqrt[2])

f[x_] = x^4+3x^3-6x^2+2x-1

g[x_] = 1+6 x-11 (x^2)+5 (x^3)-2 (x^4)

Solve[f[x]==g[x],x]

Part 2

Use the Solve command to find only the two real solutions to the equation f(x) = g(x).

We use the extra option “Reals” to accomplish this. The two real solutions are x=-(1/3), 1

Solve[f[x]==g[x],x,Reals]

Problem 4

Using the same functions f(x) and g(x) that were given in problem 3, determine the values of x for which f(x) > g(x).  Express your answer in interval notation!

Reduce[f[x]>g[x],x]

We used the reduce function, and remember that || is the Mathematica version of “or”, so x < -(1/3) or x > 1.  In interval notation, this is (-∞, -((1 )/3)) or (1, ∞).

Problem 5

Once again, we will be using the same functions f(x) and g(x) that were given in problem 3.

Part 1

Plot the functions f(x) and g(x) on the same graph, where the graph of  f(x) is magenta in color, and g(x) is cyan in color.

Fplot1 = Plot[{f[x],g[x]},{x,-1,2}, PlotStyle->{Magenta, Cyan}]

Part 2

Create a graph which shades the region between  f(x) and g(x) for 0 ≤ x ≤ 0.5, make the color of the shaded region light red.

Rplot1 = RegionPlot[g[x]>y && y> f[x] && x ≥ 0 && x≤ 0.5,{x,-0.5,1},{y,-2,2},PlotPoints->100,Axes->True,PlotRange->{{-0.5,1},{-2.0,2.0}},PlotStyle->LightRed,BoundaryStyle->None]

Part 3

Show both of the graphs from part 1 and part 2 on the same graph

Show[Fplot1, Rplot1]

Part 4

Add a plot the two intersection points of  f(x) and g(x) to the graph from Part 3 to produce a new graph which contains both functions, the shaded region, and now the two points of intersection.  Pick an icon from:

https://reference.wolfram.com/language/guide/ShapesIconsAndRelatedCharacters.html

which is NOT “▽”, and make sure that the points show up on the resulting graph!

First we need to know the actual points to put on the graph.  We know from part 2 of problem 3 that the x coordinates are  x = -(1/3)andx = 1.

f[-1/3]

f[1]

g[-1/3]

g[1]

IntPoints = {{-1/3,f[-1/3]},{1,f[1]}}

IntPlot = ListPlot[IntPoints, PlotStyle->Blue, PlotMarkers->{"★",16}];

Show[Fplot1, Rplot1, IntPlot]

Problem 6

Consider the following list: (Be sure to press shift+enter on the next line to store the list in the variable FunList).

FunList = {{1,2},{3,4,5},{{6},{7}},{8,{9,{10}}},11,12,13}

Part 1

How many elements are there in FunList?

Length[FunList]

Part 2

If we needed to get at the entry {10} in FunList, what indexing command do we need to use?

We will do this step by step!  Note that the 4th entry in the list contains element {10} as part of its list.

FunList[[4]]

The above list, {10} belongs to entry 2

FunList[[4]][[2]]

Now {10} is the second entry in the above list.

FunList[[4]][[2]][[2]]

Part 3

If we needed to get at the entry 10 in FunList, what indexing command do we need to use?

The hard work was done in part 2, so now we just slap a [[1]] on the last command from part 2.

FunList[[4]][[2]][[2]][[1]]

Part 4

Is {9, {10}} an element of FunList?  Use a Mathematica command to determine this!

MemberQ[FunList,{9,{10}}]