# Tutor profile: Scott S.

## Questions

### Subject: Python Programming

How do I find the shortest string in a list?

Let's say our list of strings is called temp. We can use a for loop to find our shortest string: short_string = "" for x in temp: if (len(x) < len(short_string)): short_string = x short_string will hold the shortest string. If there is a tie, this code will return the first string in our list with the smallest length.

### Subject: Set Theory

Show that $$|\mathbb{R}|=|\mathbb{R}-\{0\}|$$.

There are two options to show this: we can find two injections and then use the Cantor–Bernstein theorem to show that a bijection exists between the two sets. We can also find a bijection between the sets directly. First, let's find two injections. One of the injections should be fairly straightforward. Since $$\mathbb{R}-\{0\} \subseteq \mathbb{R}$$, we can use the identity function $$f:\mathbb{R}-\{0\} \rightarrow \mathbb{R}$$ of $$f(x)=x$$ as one of our injections. To find our second injection, we need a one-to-one function that does not map to 0. It would be sufficient if we could find a function that maps $$\mathbb{R}$$ to $$(0,\infty)$$. We know from algebra that the function $$f(x)=e^x$$ maps $$\mathbb{R}$$ to $$(0,\infty)$$. Thus we have our second injection. With an injection in both directions, we can now apply the Cantor–Bernstein theorem to show that there is some bijection between the two sets, which is enough to show that $$|\mathbb{R}|=|\mathbb{R}-\{x_0\}|$$. If Cantor–Bernstein was off the table, could we find a direct bijection? Consider the following function $$f:\mathbb{R}\rightarrow \mathbb{R}-\{0\}$$: $$f(x)=x+1$$ if $$x \in \{0,1,2,...\}$$ $$f(x)=x$$ otherwise First, $$f$$ is injective. For $$a,b \in \mathbb{R}$$, suppose $$f(a)=f(b)$$. If $$f(b)=f(a)=n$$ for some $$n \in \{1,2,...\}$$, then it must be that $$a=n'$$ and $$b=n''$$ for $$n',n'' \in \{0,1,2,...\}$$. Since $$f(a)=n'+1=n''+1=f(b)$$, $$n'=n''$$, which means that $$a=b$$. If $$f(a)$$ is not a natural number, $$f(a)=a=b=f(b)$$. To show $$f$$ is surjective, let $$a \in \mathbb{R}-\{0\}$$. If $$a \in \{1,2,...\}$$, then $$f(a-1)=a$$. If $$a$$ is not a natural number, then simply $$f(a)=a$$. Therefore $$f$$ is bijective. As an aside, could we find a continuous bijection between these sets? The answer is no; $$\mathbb{R}$$ is what we call a "connected" set, and $$\mathbb{R}-\{0\}$$ is not. A result of real analysis is that continuous functions preserve this "connected" property between sets, so if such a function exists it would mean that $$\mathbb{R}-\{0\}$$ would be connected.

### Subject: Calculus

$$\frac{d}{dx}e^{\sin 7x}=$$

We first can use the Chain Rule. Remember that for function $$f,g$$, $$\frac{d}{dx}f(g(x))=f'(g(x))*g'(x)$$. Here we can let $$f(x)=e^x$$ and $$g(x)=\sin 7x$$. The derivative of the exponential function is itself, i.e. $$f'(x)=e^x$$. For $$g$$, we can use the chain rule again and using the fact that $$\frac{d}{dx}\sin x= \cos x$$, we can get that $$g'(x)=7\cos 7x$$. Thus, $$\frac{d}{dx}e^{\sin 7x}=f'(g(x))*g'(x)=e^{\sin 7x}*7\cos 7x$$.