---
jupytext:
  formats: md:myst
  text_representation:
    extension: .md
    format_name: myst
    format_version: '0.8'
    jupytext_version: 1.4.1+dev
kernelspec:
  display_name: Python 3
  language: python
  name: python3
---

+++

(section:uge5S)=
# Extra (Optional) Exercises -- Long Day

+++

These exercises are optional extra material for students who are done with the exercises of the day but have the time for and the interest in more.

+++

## Extra Exercise 1: Multiplicity and Derivatives

+++

For a given polynomial $p(Z)=a_0+a_1Z+a_2Z^2+\cdot+a_nZ^n$ we define its derivative $p'(Z)$ as usual:

$$p'(Z)=a_1+2a_2Z+\cdots+na_nZ^{n-1}.$$

In this exercise we will assume that $p(Z) \in \mathbb{C}[Z]$ is a polynomial of degree no smaller than two.

+++

### Question a

+++

Assume that $\lambda \in \mathbb{C}$ is a root of $p(Z)$ with a multiplicity of two. Show that we then have $p(\lambda)=0$ and $p'(\lambda)=0$.

```{hint}
:class: dropdown
If $\lambda \in \mathbb{C}$ is a root of $p(Z)$ with a multiplicity of at least two, then a polynomial $q(Z)$ exists such that $p(Z)=(Z-\lambda)^2\cdot q(Z)$. What does this formula imply for the derivative of $p(Z)$?
```

+++

### Question b

+++

Assume that $p(\lambda)=0$ and $p'(\lambda)=0$ for some complex number $\lambda$. Show that $\lambda$ then is a root of $p(Z)$ with a multiplicity of at least two.

+++

### Question c

+++

Conclude that $\lambda$ is a root of $p(Z)$ with a multiplicity of at least two if and only if $p(\lambda)=0$ and $p'(\lambda)=0$. Also conclude that $\lambda$ is a root of $p(Z)$ with multiplicity one if and only if $p(\lambda)=0$ and $p'(\lambda) \neq 0$.

+++

## Extra Exercise 2: Secret Sharing and the Division Algorithm

+++

We are tasked with uncovering a secret code, known to be the value of $p(10)$, where $p(Z)$ is a specific polynomial of degree no higher than three with integer coefficients. A so-called _share_ of this code is given to person A, defined as the remainder $r_1(Z)$ from dividing $p(Z)$ by $d(Z)=Z^2+1$ using the division algorithm. Another share is given to person B, which is the remainder $r_2(Z)$ from dividing $p(Z)$ by $d(Z)=Z^2-1$ using the division algorithm. 

+++

### Question a

+++

Person A is now being told that their share is $r_1(Z)=7Z-2$. Provide two different polynomials $p_1(Z)$ and $p_2(Z)$ with integer coefficients and degrees no higher than three that both yield a remainder of $7Z-2$ when divided by $d(Z)=Z^2+1$ using the division algorithm. Conclude that person A cannot uncover the secret code on his/her own. (A similar argument shows that person B also cannot crack the secret code alone).


+++

### Question b

+++

Now persons A and B meet and reveal their shares to each other. The shares are $r_1(Z)=7Z-2$ and $r_2(Z)=11Z+18$, respectively. Determine the secret code.

```{admonition} Answer
:class: dropdown
The code is $3098$ (and $p(Z)=2Z^3+10Z^2+9Z+8$).
```