Midterm

You have two hours to complete the following questions. I will be available during this time only, after 1:30 you will not be able to submit your assignment. Make sure that it is finished and uploaded before this time.

Question #1: The input of the following functions are positive integers n and r. Explain in words what the following two functions do and how they work:
> dig:=(n,r)->irem(iquo(n,10^(r-1)),10);
> ds:=n->[seq(dig(n,r),r=1..ceil(log10(n+1.)))];

Explain why in Maple it is the case that the command ds(10^10) behaves differently than ds(10^3).

Question #2: Let st be your student id number. Consider the graph of the function:
> plot(mul(cos(Pi*x/(v+1))^2, v = ds(irem(st,10000)), x = 0 .. 10!);
Count how many times the this function is equal to 1 in the interval from 0 to 10! (10 factorial). It will only be 1 for integer values of $x$ so one way of doing this is by running through a loop and testing when mul(cos(Pi*x/(v+1))^2, v = ds(irem(st,10000)) is equal to 1.

Question #3: Find the area between the two functions $6 sin(x)$ and $sin(x) sin^2(3x)$ and plot the graphs between 0 and $2\pi$.

Question #4: Let $d_0 = 1$, $d_1 = 1$ and for $n>1$, $d_{n+1} = 3 d_n - d_{n-1}$. Estimate the limit of $d_{n+1}/d_n$ as $n \rightarrow \infty$ to 3 decimal places.

Question #5: Let $a_n$ be number where the digit 3 repeated $n$ times followed by 1 repeated $n$ times (e.g. $a_5 = 3333311111$). For which values of $1 \leq n \leq 15$ is $a_n$ divisible by 13?

NOTE THAT THE PENALTY FOR HANDING THIS IS LATE IS QUITE STRICT. I WANT YOU TO DO THIS IN THE ALOTTED TIME. You should be able to complete this quiz within the class time. If you finish after the class time your overall grade for this assignment will be reduced by 20% per hour (or part thereof). Make sure that your file is uploaded by 1:30pm. Upload your worksheet to the course moodle.

You are expected to work alone on this assignment. Any indication of academic dishonesty will result in a 0 for the assignment and possible higher penalties.