From d6c61d988bfa4255baf9cdae42db59ebee38363f Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 25 May 2021 17:10:49 +0200 Subject: Added files --- .../.ipynb_checkpoints/solution-checkpoint.ipynb | 166 +++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 src/Homework3/.ipynb_checkpoints/solution-checkpoint.ipynb (limited to 'src/Homework3/.ipynb_checkpoints/solution-checkpoint.ipynb') diff --git a/src/Homework3/.ipynb_checkpoints/solution-checkpoint.ipynb b/src/Homework3/.ipynb_checkpoints/solution-checkpoint.ipynb new file mode 100644 index 0000000..41ee2ea --- /dev/null +++ b/src/Homework3/.ipynb_checkpoints/solution-checkpoint.ipynb @@ -0,0 +1,166 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Exercise 1**\n", + "\n", + "Use SageMath to solve the following problems:\n", + "\n", + "(a) Find the roots of the following polynomial over $\\mathbb Q$:\n", + "\\begin{align*}\n", + " p = 4 x^{7} + 4 x^{6} + 3 x^{5} - 13 x^{4} - 13 x^{3} - 9 x^{2} + 3 x + 3 \\in \\mathbb Q[x]\n", + "\\end{align*}\n", + "\n", + "(b) Find the roots of the same polynomial $p$ over $\\mathbb R$ and over $\\mathbb C$.\n", + "\n", + "(c) Find the determinant, the trace and the characteristic polynomial of the following matrix:\n", + "\\begin{align*}\n", + "A=\\left(\\begin{array}{rrrr}\n", + "-1 & 1 & -1 & 0 \\\\\n", + "1 & \\frac{1}{2} & 1 & 0 \\\\\n", + "\\frac{1}{2} & -\\frac{1}{2} & -2 & 1 \\\\\n", + "0 & 0 & 1 & 1\n", + "\\end{array}\\right)\n", + "\\end{align*}\n", + "\n", + "(d) Find a solution to the linear system $A\\mathbf x =\\mathbf v$, where $A$ is the matrix above and $\\mathbf v=(1, 2, 3, 4)$.\n", + "\n", + "Write your code in the cell below." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Exercise 2**\n", + "\n", + "*(Yes, I know that the exercise is long to read, but it will not be so long to solve. It is a cool application of cryptography which, similarly to RSA, is based on the fact that factoring a number is hard.)*\n", + "\n", + "After exchanging messages with the RSA protocol seen in class, Alice and Bob decide to meet and play their favorite game: flip a coin. They like this game very much because it does not take much time to set it up and they have exactly the same chances of winning.\n", + "\n", + "Unfortunately, due to the COVID-19 pandemic they cannot meet in person, and they despite being good friends they don't trust each other enough to play this game via videocall. Luckily, Alice is an expert in cryptography and she knows how to play this game using the Chinese remainder theorem.\n", + "\n", + "The game plays as follows:\n", + "\n", + "(A1) Alice picks two large prime numbers $p$ and $q$, she computes $n=pq$ and sends $n$ to Bob, keeping $p$ and $q$ secret.\n", + "\n", + "(B1) Bob picks a random number $a$ with $1