Question Sheet 1 - Challenge Problem Example Answers

A key skill in computing is finding solutions to problems. There are often many ways to tackle a problem. In general, others have already spent considerable time thinking through the best way to approach something. Therefore, it is in general good to investigate if the problem you are trying to solve has already been solved. Some good resources include:

1. Mathematica StackExchange
2. Students who have more experience working with Mathematica so may have overcome similar roadblocks before
3. A simple google query. 

This week we saw how to plot a single graph. Often in science we want to compare two sets of data. Reproduce the following graph, where the most important additional feature is the legend:

The following code is used:

Plot[{Sin[2x],Cos[(x/2)]},{x,0,4π},Frame->True,PlotLegends->"Expressions"]

Where the “Expressions” command means that the name of that graph is the expression that Mathematica used to plot it. Alternatively one could type something like:

Plot[{Sin[2x],Cos[(x/2)]},{x,0,4π},Frame->True,PlotLegends->{"Graph 1", "Graph 2"}]