# Tutor profile: John Z.

## Questions

### Subject: Python Programming

Modify lines 6 and 9 so that the merge_sort function will work correctly: #CODE def merge_sort(alist): if len(alist)>1: mid = len(alist)//2 lefthalf = alist[:mid] righthalf = alist[:mid] merge_sort(lefthalf) merge_sort(lefthalf) i=0 j=0 k=0 while i < len(lefthalf) and j < len(righthalf): if lefthalf[i] < righthalf[j]: alist[k]=lefthalf[i] i=i+1 else: alist[k]=righthalf[j] j=j+1 k=k+1 while i < len(lefthalf): alist[k]=lefthalf[i] i=i+1 k=k+1 while j < len(righthalf): alist[k]=righthalf[j] j=j+1 k=k+1 sorted_list = alist return sorted_list

The solution is to modify line 6 so it reads: righthalf = alist[mid:], and to modify line 9 so it reads: merge_sort(righthalf).

### Subject: Linear Algebra

Let $$U$$ and $$V$$ be three-dimensional subspaces of $$\mathbb{R}^5$$, and let $$W = U\cap V$$. Find all possible values for the dimension of $$W$$.

To calculate the possible dimensions, note $$\dim(U\cup V) = \dim(U) + \dim(V) - \dim(W) = 6 - \dim(W)$$. As the maximum possible value of the LHS is $$5$$ as we are in a 5-dimensional space, and the minimum possible value is $$3$$ due to the sizes of $$U$$ and $$V$$, the only possible values for $$W$$ are $$1, 2, 3$$, of which we can easily construct examples. From a fundamental side, as we are in a 5-dimensional space, any such $$W$$ we find could not be empty. If $$W$$ were empty, this would imply, as $$U$$ and $$V$$ are three-dimensional subspaces, and we could find an independent basis of size 3 for both subspaces, say $$\{u_1, u_2, u_3\}$$ and $$\{v_1, v_2, v_3\}$$, respectively, that these basis would also be independent of each other ($$W$$ being empty implies $$v_1$$ is not an element of the span of $$\{u_1, u_2, u_3\}$$, etc).

### Subject: Calculus

Please find the value of the following expression: $(\lim_{x\rightarrow 2}\frac{\sqrt{x-2}}{\ln (x-1)}$)

As both expressions tend to 0 as x goes to 2, we can use L'Hôpital's rule to find the limit. Taking derivatives of both the numerator and denominator, we obtain: $(\lim_{x\rightarrow 2}\frac{\sqrt{x-2}}{\ln (x-1)} = \lim_{x\rightarrow 2}\frac{\frac{1}{2\sqrt{x-2}}}{\frac{1}{x-1}}.$) As x goes to 2, $$\frac{1}{2\sqrt{x-2}}$$ goes to infinity as its denominator goes to 0, while $$\frac{1}{x-1}$$ goes to 1. Therefore, we see that the entire limit expression tends to infinity, which is our answer.