added epr rep files
Some checks failed
build-latex / build (push) Has been cancelled

This commit is contained in:
Jonas_Jones 2025-06-20 22:52:20 +02:00
parent 3076cc12e6
commit fe600d3146
39 changed files with 1676 additions and 0 deletions

View file

@ -0,0 +1,98 @@
%% Mathematical Institute, University of Oxford
%% LaTeX Beamer Presentation Theme
%%
%% v1.0 Original theme: Tim Hosgood 2015 (based on department PowerPoint Template)
%% v2.0 Reimplementation: Karl Welzel May 2024 (reimplementation from a standard theme)
%% v2.1 Further adjustments and tweaks: Keith Gillow May 2024
% Use infolines as base
\useoutertheme{infolines}
% tweak colours for Oxford Blue
\definecolor{oxfordblue}{RGB}{0,33,71}
\usecolortheme[named=oxfordblue]{structure}
%turn off the navigation symbols
\setbeamertemplate{navigation symbols}{}
% define useful layout lengths
\newlength{\textmargin}
\setlength{\textmargin}{10mm} % Left and right margin for main content
\setbeamersize{text margin left=\textmargin,text margin right=\textmargin}
\newlength{\titlehmargin}
\setlength{\titlehmargin}{5mm} % Left and right margin for title and footline
\newlength{\titlevmargin}
\setlength{\titlevmargin}{1mm} % Top and bottom margin for title and footline
\newlength{\fullpagewidth}
\setlength{\fullpagewidth}{\dimexpr\textwidth+\textmargin+\textmargin\relax}
% Calculate widths from heights for the logos
\newlength{\oxfordlogowidth}
\setlength{\oxfordlogowidth}{\dimexpr 10mm * 214 / 311 \relax}
\newlength{\mathslogowidth}
\setlength{\mathslogowidth}{\dimexpr 3mm * 347 / 105 \relax}
%% Title slide formatting %%
\setbeamertemplate{title page}{
\begin{picture}(0,0)
\put(-\textmargin, \dimexpr -\paperheight*6/10 \relax){%
\ifdim\paperwidth>400pt
\includegraphics[width=\paperwidth]{title-slide-background-wide.png}
\else
\includegraphics[width=\paperwidth]{title-slide-background.png}
\fi
}
\put(-\textmargin +7mm, -55pt){%
\begin{minipage}[b][4.5cm][t]{0.7\textwidth}
\raggedright
\color{white}
\usebeamerfont{title}
{\inserttitle\\[0.9cm]}
\usebeamerfont{subtitle}
{\sc\insertauthor\\[0.1cm]}
{\it\insertinstitute\\[0.3cm]}
{\insertdate}
\end{minipage}
}
\end{picture}
}
%% General slide header %%
\setbeamertemplate{frametitle}{%
\rlap{%
\begin{beamercolorbox}[sep=\titlevmargin,left,wd=\dimexpr\fullpagewidth-\titlehmargin*2+\titlevmargin*2\relax]{frametitle}%
\begin{minipage}{\dimexpr\fullpagewidth-\oxfordlogowidth-\titlehmargin*3-0.1cm\relax}%
\strut\insertframetitle\strut\par%
\end{minipage}%
\hspace{\titlehmargin}%
\begin{minipage}{\dimexpr\oxfordlogowidth+1mm\relax}%
\hfill
\vspace*{-4mm}
\includegraphics[width=\oxfordlogowidth]{oxford-logo.png}%
\end{minipage}%
\end{beamercolorbox}%
}%
\vspace{\dimexpr-\baselineskip+1ex\relax}%
\noindent\rlap{\hspace{-\textmargin}\hspace{\titlehmargin}\rule{\dimexpr\fullpagewidth-\titlehmargin*2\relax}{0.4pt}}%
\vspace{-0.6ex}%
}
%% General slide footer %%
\setbeamertemplate{footline}{%
\noindent\hspace{\titlehmargin}\rule{\dimexpr\fullpagewidth-\titlehmargin*2\relax}{0.4pt}\par%
\vspace{\titlevmargin}%
\leavevmode%
\noindent\hspace{\dimexpr\titlehmargin-\titlevmargin\relax}%
\begin{beamercolorbox}[sep=\titlevmargin,wd=\dimexpr\fullpagewidth-\titlehmargin*2+\titlevmargin*2\relax]{footline}%
\begin{minipage}{\dimexpr\mathslogowidth+1pt\relax}%
\includegraphics[width=\mathslogowidth]{mathematics-logo.png}%
\end{minipage}%
\hfill%
{\usebeamercolor[fg]{title in head/foot}\usebeamerfont{title in head/foot}\insertshorttitle}%
\hfill%
{\usebeamercolor[fg]{date in head/foot}\usebeamerfont{date in head/foot}\insertshortdate{}}%
\hfill%
{\usebeamercolor[fg]{page number in head/foot}\usebeamerfont{page number in head/foot}\usebeamertemplate{page number in head/foot}}%
\end{beamercolorbox}
\vspace{\titlevmargin}%
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8 KiB

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 KiB

View file

@ -0,0 +1,108 @@
\documentclass{article}
\usepackage{amsmath}
\usepackage{listings}
\usepackage{xcolor}
\definecolor{codegray}{rgb}{0.9,0.9,0.9}
\lstdefinestyle{pythonstyle}{
backgroundcolor=\color{codegray},
basicstyle=\ttfamily\footnotesize,
language=Python,
frame=single,
keywordstyle=\color{blue},
commentstyle=\color{gray},
stringstyle=\color{red}
}
\begin{document}
\title{Python Übungsaufgaben: Funktionen, Iteration und Rekursion}
\date{28. Februar, 2025}
\maketitle
\section*{Aufgabe 1: Einfache Funktionen}
\subsection*{Quadrat einer Zahl}
Schreibe eine Funktion, die das Quadrat einer Zahl berechnet.
\begin{lstlisting}[style=pythonstyle]
def square(n):
return n*n
\end{lstlisting}
\subsection*{Maximalwert zweier Zahlen}
Schreibe eine Funktion, die den größeren von zwei gegebenen Zahlen zurückgibt.
\begin{lstlisting}[style=pythonstyle]
def min_value(a,b)
return min(a,b)
\end{lstlisting}
\subsection*{Umwandlung von Celsius in Fahrenheit}
Schreibe eine Funktion, die eine Temperatur in Celsius in Fahrenheit umwandelt.
\begin{lstlisting}[style=pythonstyle]
def convert_c_to_f(n):
return n*(9/5)+32
\end{lstlisting}
\subsection*{Summation einer Liste}
Schreibe eine Funktion, die die Summe aller Elemente in einer Liste berechnet.
\begin{lstlisting}[style=pythonstyle]
def convert_c_to_f(n):
sum = 0
for item in b:
sum += item
return sum
\end{lstlisting}
\section*{Aufgabe 2: Fakultät mit Iteration und Rekursion}
Berechne die Fakultät einer Zahl $n$ sowohl iterativ als auch rekursiv.
\subsection*{Iterative Lösung}
Schreibe eine iterative Funktion zur Berechnung der Fakultät.
\begin{lstlisting}[style=pythonstyle]
def fakultaet_iterativ(n):
ergebnis = 1
for i in range(1, n + 1):
ergebnis *= i
return ergebnis
\end{lstlisting}
\subsection*{Rekursive Lösung}
Schreibe eine rekursive Funktion zur Berechnung der Fakultät.
\begin{lstlisting}[style=pythonstyle]
def fakultaet_rekursiv(n):
if n == 0:
return 1
return n * fakultaet_rekursiv(n - 1)
\end{lstlisting}
\section*{Aufgabe 3: Fibonacci-Zahlen}
Berechne die Fibonacci-Zahlen $F(n)$ mit $F(0) = 0$, $F(1) = 1$ und $F(n) = F(n-1) + F(n-2)$ für $n \geq 2$.
\subsection*{Iterative Lösung}
Schreibe eine iterative Funktion zur Berechnung der Fibonacci-Zahlen.
\begin{lstlisting}[style=pythonstyle]
def fakultaet_rekursiv(n):
a, b = 0, 1
for _ in range(n):
a, b = b, a + b
return a
\end{lstlisting}
\subsection*{Rekursive Lösung}
Schreibe eine rekursive Funktion zur Berechnung der Fibonacci-Zahlen.
\begin{lstlisting}[style=pythonstyle]
def fibonacci_rekursiv(n):
if n <= 1:
return n
return fibonacci_rekursiv(n - 1) + fibonacci_rekursiv(n - 2)
\end{lstlisting}
\end{document}