[exercises] translation
This commit is contained in:
parent
99fac2be07
commit
ee18cd17d1
@ -14,8 +14,7 @@
|
|||||||
%%%%% text size %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%% text size %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
\usepackage[left=20mm,right=20mm,top=25mm,bottom=25mm]{geometry}
|
\usepackage[left=20mm,right=20mm,top=25mm,bottom=25mm]{geometry}
|
||||||
\pagestyle{headandfoot} \header{{\bfseries\large \"Ubung
|
\pagestyle{headandfoot} \header{{\bfseries\large \"Ubung
|
||||||
3}}{{\bfseries\large Boolesche Ausdr\"ucke, logisches
|
3}}{{\bfseries\large Boolean Expressions and logical indexing}}{{\bfseries\large 24. Oktober, 2017}}
|
||||||
Indizieren}}{{\bfseries\large 31. Oktober, 2016}}
|
|
||||||
\firstpagefooter{Dr. Jan Grewe}{Phone: 29 74588}{Email:
|
\firstpagefooter{Dr. Jan Grewe}{Phone: 29 74588}{Email:
|
||||||
jan.grewe@uni-tuebingen.de} \runningfooter{}{\thepage}{}
|
jan.grewe@uni-tuebingen.de} \runningfooter{}{\thepage}{}
|
||||||
|
|
||||||
@ -31,25 +30,24 @@
|
|||||||
|
|
||||||
\vspace*{-6.5ex}
|
\vspace*{-6.5ex}
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\textbf{\Large Einf\"uhrung in die wissenschaftliche Datenverarbeitung}\\[1ex]
|
\textbf{\Large Introduction to scientific computing}\\[1ex]
|
||||||
{\large Jan Grewe, Jan Benda}\\[-3ex]
|
{\large Jan Grewe, Jan Benda}\\[-3ex]
|
||||||
Abteilung Neuroethologie \hfill --- \hfill Institut f\"ur Neurobiologie \hfill --- \hfill \includegraphics[width=0.28\textwidth]{UT_WBMW_Black_RGB} \\
|
Abteilung Neuroethologie \hfill --- \hfill Institut f\"ur Neurobiologie \hfill --- \hfill \includegraphics[width=0.28\textwidth]{UT_WBMW_Black_RGB} \\
|
||||||
\end{center}
|
\end{center}
|
||||||
|
|
||||||
Die folgenden Aufgaben dienen der Wiederholung, \"Ubung und
|
The exercises are meant for self-monitoring, revision of the lecture
|
||||||
Selbstkontrolle und sollten eigenst\"andig bearbeitet und gel\"ost
|
topic. You should try to solve them on your own. Your solution should
|
||||||
werden. Die L\"osung soll in Form eines einzelnen Skriptes (m-files)
|
be submitted as a single script (m-file) in the Ilias system. Each
|
||||||
im ILIAS hochgeladen werden. Jede Aufgabe sollte in einer eigenen
|
task should be solved in its own ``cell''. Each cell must be
|
||||||
``Zelle'' gel\"ost sein. Die Zellen \textbf{m\"ussen} unabh\"angig
|
executable on its own. The file should be named according to the following pattern:
|
||||||
voneinander ausf\"uhrbar sein. Das Skript sollte nach dem Muster:\newline
|
``variables\_datatypes\_\{lastname\}.m'' benannt werden
|
||||||
``boolesche\_ausdruecke\_\{nachname\}.m'' benannt werden
|
(e.g. variables\_datentypes\_mueller.m).
|
||||||
(z.B. variablen\_datentypen\_mueller.m).
|
|
||||||
|
|
||||||
\section{Boolesche Ausdr\"ucke}
|
\section{Boolean expressions}
|
||||||
|
|
||||||
\begin{questions}
|
\begin{questions}
|
||||||
\question Gegeben sind zwei Vektoren \verb+x = [1 5 2 8 9 0 1]+ und
|
\question Consider the following vectors \verb+x = [1 5 2 8 9 0 1]+ and
|
||||||
\verb+y = [5 2 2 6 0 0 2]+. F\"uhre aus und erkl\"are.
|
\verb+y = [5 2 2 6 0 0 2]+. Execute the following commands and explain.
|
||||||
\begin{parts}
|
\begin{parts}
|
||||||
\part \verb+x > y+
|
\part \verb+x > y+
|
||||||
\part \verb+y < x+
|
\part \verb+y < x+
|
||||||
@ -59,32 +57,29 @@ voneinander ausf\"uhrbar sein. Das Skript sollte nach dem Muster:\newline
|
|||||||
\part \verb+x | y+
|
\part \verb+x | y+
|
||||||
\end{parts}
|
\end{parts}
|
||||||
|
|
||||||
\question Finde heraus, was die Funktionen \verb+bitand+ und \verb+bitor+ machen.
|
\question Find out what the functions \verb+bitand+ and \verb+bitor+ do.
|
||||||
\begin{parts}
|
\begin{parts}
|
||||||
\part F\"uhre aus und erkl\"are: \verb+bitand(10, 8)+
|
\part Execute and explain: \verb+bitand(10, 8)+
|
||||||
\part F\"uhre aus und erkl\"are: \verb+bitor(10, 8)+
|
\part Execute and explain: \verb+bitor(10, 8)+
|
||||||
\end{parts}
|
\end{parts}
|
||||||
\item Implementiere folgende Boolesche Ausdr\"ucke. Teste mit
|
\item Implemen the following Boolean expressions. Test using randomly selected integer values for \verb+x+ and \verb+y+.
|
||||||
zuf\"alligen ganzzahlingen Werten f\"ur \verb+x+ und \verb+y+.
|
|
||||||
\begin{parts}
|
\begin{parts}
|
||||||
\part Das Ergebnis sei wahr, wenn \verb+x+ gr\"o{\ss}er als \verb+y+ und die
|
\part The result should be \verb+true+ if \verb+x+ greater than \verb+y+ and the sum of \verb+x+ and \verb+y+ is not less than 100.
|
||||||
Summe aus \verb+x+ und \verb+y+ nicht kleiner als 100 ist.
|
\part The result shoudl be \verb+true+ if \verb+x+ and \verb+y+ are not equal zero or \verb+x+ and \verb+y+ are equal.
|
||||||
\part Das Ergebnis sei wahr, wenn \verb+x+ und \verb+y+ ungleich 0
|
|
||||||
oder \verb+x+ und \verb+y+ gleich sind.
|
|
||||||
\end{parts}
|
\end{parts}
|
||||||
\end{questions}
|
\end{questions}
|
||||||
|
|
||||||
\newpage
|
\newpage
|
||||||
\section{Logische Indizierung}
|
\section{Logical Indexing}
|
||||||
|
|
||||||
Boolesche Ausdr\"ucke k\"onnen benutzt werden um aus Vektoren und
|
Boolean expressions can be used to select elements of vectors or
|
||||||
Matrizen die Elemente herauszusuchen, die einem bestimmeten Kriterium
|
matrices that match in certain criteria. This process is called
|
||||||
entsprechen.
|
logical indexing.
|
||||||
|
|
||||||
\begin{questions}
|
\begin{questions}
|
||||||
\question Gegeben sind \verb+x = (1:10)+ und
|
\question Given are the vectors \verb+x = (1:10)+ and
|
||||||
\verb+y = [3 1 5 6 8 2 9 4 7 0]+. Versuche die Ausgaben folgender
|
\verb+y = [3 1 5 6 8 2 9 4 7 0]+. Try to understand the results of
|
||||||
Anweisungen zu verstehen. Erkl\"are die Ergebnisse.
|
the following commands. Explain.
|
||||||
\begin{parts}
|
\begin{parts}
|
||||||
\part \verb+x < 5+
|
\part \verb+x < 5+
|
||||||
\part \verb+x( x < 5) )+
|
\part \verb+x( x < 5) )+
|
||||||
@ -93,15 +88,11 @@ entsprechen.
|
|||||||
\part \verb+x( (x == 0) & (y == 0) )+
|
\part \verb+x( (x == 0) & (y == 0) )+
|
||||||
\end{parts}
|
\end{parts}
|
||||||
|
|
||||||
\question Teste den Zufallsgenerator:
|
\question Test the random number generator:
|
||||||
\begin{parts}
|
\begin{parts}
|
||||||
\part Erzeuge eine 100x100 2-D Matrize mit Zufallswerten zwischen
|
\part Create a 100x100 2-D matrix that is filled with random numbers in the range 0 to 100 (\verb+randi+). Replace the elements according to these rules: \verb+x < 33+ to 0,
|
||||||
0 und 100 (\verb+randi+). Ersetze die Werte der Elemente, die in
|
\verb+x >= 33 and x < 66+ to 1 and all \verb+x >= 66+ to 2.
|
||||||
folgende Klassen fallen: \verb+x < 33+ mit 0,
|
\part Count the number of elements in each class using Boolean expressions (\verb+sum+ can be used to count the matches).
|
||||||
\verb+x >= 33 und x < 66+ mit 1 und alle \verb+x >= 66+ auf 2.
|
|
||||||
\part Ermittle die Anzahl Elemente f\"ur jede Klasse mithilfe eines
|
|
||||||
Booleschen Ausdrucks (\verb+sum+ kann eingesetzt werden um die
|
|
||||||
Anzahl Treffer zu ermitteln).
|
|
||||||
\end{parts}
|
\end{parts}
|
||||||
\end{questions}
|
\end{questions}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user