From db7e9fa33cc874b343f9f8ba7b86978943dd5bbd Mon Sep 17 00:00:00 2001
From: Camil Staps
Date: Fri, 25 Sep 2015 10:24:44 +0200
Subject: Start assignment 4

---
 assignment4/assignment4.tex | 51 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 assignment4/assignment4.tex

(limited to 'assignment4/assignment4.tex')

diff --git a/assignment4/assignment4.tex b/assignment4/assignment4.tex
new file mode 100644
index 0000000..e31b35e
--- /dev/null
+++ b/assignment4/assignment4.tex
@@ -0,0 +1,51 @@
+\documentclass[10pt,a4paper]{article}
+
+\usepackage[margin=2cm]{geometry}
+
+\usepackage{minted}
+
+\usepackage{enumitem}
+\setenumerate[1]{label=\alph*.}
+
+% textcomp package is not available everywhere, and we only need the Copyright symbol
+% taken from http://tex.stackexchange.com/a/1677/23992
+\DeclareTextCommandDefault{\textregistered}{\textcircled{\check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont R}}
+
+\usepackage{fancyhdr}
+\renewcommand{\headrulewidth}{0pt}
+\renewcommand{\footrulewidth}{0pt}
+\fancyhead{}
+\fancyfoot[C]{Copyright {\textcopyright} 2015 Camil Staps}
+\pagestyle{fancy}
+
+\usepackage{amsmath}
+\usepackage{amsfonts}
+
+\usepackage{enumitem}
+\setenumerate[1]{label=\alph*.}
+
+\parindent0pt
+
+\title{Operating Systems - assignment 4}
+\author{Camil Staps\\\small{s4498062}}
+
+\begin{document}
+
+\maketitle
+\thispagestyle{fancy}
+
+\section*{6.11}
+%todo
+
+\section*{6.18}
+\begin{enumerate}
+    \item If there are two types of philosophers, the fourth condition of deadlock (circular wait) is not fulfilled. Lefties and righties can never be in a chain waiting for resources. Therefore, deadlock cannot occur.
+    \item On a table with two philosophers, of which one is a lefty and one a righty, it is obvious to see that one philosopher will start eating and when he is done, the other one can grab the forks. No starvation occurs.
+
+        If on a table with $k$ philosophers no starvation occurs, and we add another philosopher $p$, this new philosopher is placed between two philosophers who, at some point, will eat. Then at some point the first fork $p$ wants to take will be free, and also at some point the other fork $p$ needs will be free. Hence, $p$ will also eat.
+
+        From the principle of induction it now follows that starvation cannot occur on a table with $n\ge2$ philosophers, as long as there is at least one lefty and one righty.
+\end{enumerate}
+
+\end{document}
+
-- 
cgit v1.2.3

