few updates to first exercises, create script without solutions
This commit is contained in:
		
							parent
							
								
									e500280c07
								
							
						
					
					
						commit
						aef9a4d36c
					
				@ -294,7 +294,7 @@
 | 
				
			|||||||
  chapterlistsgaps=on,
 | 
					  chapterlistsgaps=on,
 | 
				
			||||||
]{exercisef}
 | 
					]{exercisef}
 | 
				
			||||||
\newboolean{showexercisesolutions}
 | 
					\newboolean{showexercisesolutions}
 | 
				
			||||||
\setboolean{showexercisesolutions}{true}
 | 
					\setboolean{showexercisesolutions}{false}
 | 
				
			||||||
\newenvironment{exercise}[2]%
 | 
					\newenvironment{exercise}[2]%
 | 
				
			||||||
  { \newcommand{\exercisesource}{#1}%
 | 
					  { \newcommand{\exercisesource}{#1}%
 | 
				
			||||||
    \newcommand{\exercisefile}{\protect\StrSubstitute{#1}{_}{\_}}%
 | 
					    \newcommand{\exercisefile}{\protect\StrSubstitute{#1}{_}{\_}}%
 | 
				
			||||||
 | 
				
			|||||||
@ -14,7 +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}
 | 
					\pagestyle{headandfoot}
 | 
				
			||||||
\header{{\bfseries\large Exercise 3}}{{\bfseries\large Matrices}}{{\bfseries\large 23. Oktober, 2017}}
 | 
					\header{{\bfseries\large Exercise 3}}{{\bfseries\large Matrices}}{{\bfseries\large 22. Oktober, 2018}}
 | 
				
			||||||
\firstpagefooter{Dr. Jan Grewe}{Phone: 29 74588}{Email:
 | 
					\firstpagefooter{Dr. Jan Grewe}{Phone: 29 74588}{Email:
 | 
				
			||||||
  jan.grewe@uni-tuebingen.de}
 | 
					  jan.grewe@uni-tuebingen.de}
 | 
				
			||||||
\runningfooter{}{\thepage}{}
 | 
					\runningfooter{}{\thepage}{}
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
\documentclass[12pt,a4paper,pdftex, answers]{exam}
 | 
					\documentclass[12pt,a4paper,pdftex]{exam}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\usepackage[german]{babel}
 | 
					\usepackage[german]{babel}
 | 
				
			||||||
\usepackage{natbib}
 | 
					\usepackage{natbib}
 | 
				
			||||||
@ -15,7 +15,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}
 | 
					\pagestyle{headandfoot}
 | 
				
			||||||
\header{{\bfseries\large Exercise 1}}{{\bfseries\large Variables und Datatypes}}{{\bfseries\large 17. Oktober, 2017}}
 | 
					\header{{\bfseries\large Exercise 1}}{{\bfseries\large Variables und Datatypes}}{{\bfseries\large 16. Oktober, 2018}}
 | 
				
			||||||
\firstpagefooter{Dr. Jan Grewe}{Phone: 29 74588}{Email:
 | 
					\firstpagefooter{Dr. Jan Grewe}{Phone: 29 74588}{Email:
 | 
				
			||||||
  jan.grewe@uni-tuebingen.de}
 | 
					  jan.grewe@uni-tuebingen.de}
 | 
				
			||||||
\runningfooter{}{\thepage}{}
 | 
					\runningfooter{}{\thepage}{}
 | 
				
			||||||
@ -37,18 +37,18 @@
 | 
				
			|||||||
  Neuroethology \hfill --- \hfill Institute for Neurobiology \hfill --- \hfill \includegraphics[width=0.28\textwidth]{UT_WBMW_Black_RGB} \\
 | 
					  Neuroethology \hfill --- \hfill Institute for Neurobiology \hfill --- \hfill \includegraphics[width=0.28\textwidth]{UT_WBMW_Black_RGB} \\
 | 
				
			||||||
\end{center}
 | 
					\end{center}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The exercises are meant for self-monitoring, revision of the lecture
 | 
					The exercises are meant for self-monitoring and revision of the
 | 
				
			||||||
topic. You should try to solve them on your own. Your solution should
 | 
					lecture. You should try to solve them on your own. Your solution
 | 
				
			||||||
be submitted as a single script (m-file) in the Ilias system. Each
 | 
					should be submitted as a single script (m-file) in the Ilias
 | 
				
			||||||
task should be solved in its own ``cell''. Each cell must be
 | 
					system. Each task should be solved in its own ``cell''. Each cell must
 | 
				
			||||||
executable on its own. The file should be named according to the following pattern:
 | 
					be executable on its own. The file should be named according to the
 | 
				
			||||||
``variables\_datatypes\_\{lastname\}.m'' benannt werden
 | 
					following pattern: ``variables\_datatypes\_\{lastname\}.m''
 | 
				
			||||||
(e.g. variables\_datentypes\_mueller.m).
 | 
					(e.g. variables\_datatypes\_mueller.m).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{questions}
 | 
					\begin{questions}
 | 
				
			||||||
  \question Creating and deleting variables:
 | 
					  \question Creating and deleting variables:
 | 
				
			||||||
  \begin{parts}
 | 
					  \begin{parts}
 | 
				
			||||||
    \part Create two new variables  \code{a}, \code{b} and assign arbitrary values to them. End each command with a semicolon. Create a variable \code{c} that is empty.
 | 
					    \part Create two new variables  \code{a}, \code{b} and assign arbitrary values to them. End each command with a semicolon. Create a empty variable \code{c}.
 | 
				
			||||||
    \begin{solution}
 | 
					    \begin{solution}
 | 
				
			||||||
      \code{a = 1;} \code{b = 2;} \code{c = [];}
 | 
					      \code{a = 1;} \code{b = 2;} \code{c = [];}
 | 
				
			||||||
    \end{solution}
 | 
					    \end{solution}
 | 
				
			||||||
@ -80,15 +80,15 @@ executable on its own. The file should be named according to the following patte
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  \question Working with variables:
 | 
					  \question Working with variables:
 | 
				
			||||||
  \begin{parts}
 | 
					  \begin{parts}
 | 
				
			||||||
    \part Create two new variables  \code{a}, \code{b} and assign arbitrary numeric values.
 | 
					    \part Create two new variables  \code{a} and \code{b} and assign arbitrary numeric values.
 | 
				
			||||||
    \begin{solution}
 | 
					    \begin{solution}
 | 
				
			||||||
      \code{a = 5; b = 3.14;}
 | 
					      \code{a = 5; b = 3.14;}
 | 
				
			||||||
    \end{solution}
 | 
					    \end{solution}
 | 
				
			||||||
    \part Add a number to \code{a} and \code{b}.
 | 
					    \part Add an arbitrary number to \code{a} and \code{b}.
 | 
				
			||||||
    \begin{solution}
 | 
					    \begin{solution}
 | 
				
			||||||
      \code{a + 5} \code{b + 7.28}
 | 
					      \code{a + 5;} \code{b + 7.28;}
 | 
				
			||||||
    \end{solution}
 | 
					    \end{solution}
 | 
				
			||||||
    \part Add the variables themselves.
 | 
					    \part Add the variables \code{a} and \code{b}.
 | 
				
			||||||
    \begin{solution}
 | 
					    \begin{solution}
 | 
				
			||||||
      \code{a + b}
 | 
					      \code{a + b}
 | 
				
			||||||
    \end{solution}
 | 
					    \end{solution}
 | 
				
			||||||
@ -98,7 +98,7 @@ executable on its own. The file should be named according to the following patte
 | 
				
			|||||||
    \end{solution}
 | 
					    \end{solution}
 | 
				
			||||||
    \part Do \code{a} and \code{b} change?
 | 
					    \part Do \code{a} and \code{b} change?
 | 
				
			||||||
    \begin{solution}
 | 
					    \begin{solution}
 | 
				
			||||||
      No, we make use of the stored values, the values remaing untouched.
 | 
					      No, we make use of the stored values, the variables remain untouched.
 | 
				
			||||||
    \end{solution}
 | 
					    \end{solution}
 | 
				
			||||||
    \part Execute any arithmetic operation with \code{a} and \code{b} and store the result in a new variabel \code{x}.
 | 
					    \part Execute any arithmetic operation with \code{a} and \code{b} and store the result in a new variabel \code{x}.
 | 
				
			||||||
    \begin{solution}
 | 
					    \begin{solution}
 | 
				
			||||||
@ -110,15 +110,18 @@ executable on its own. The file should be named according to the following patte
 | 
				
			|||||||
    \end{solution}
 | 
					    \end{solution}
 | 
				
			||||||
  \end{parts}
 | 
					  \end{parts}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  \question Calculate the faculty of 5:
 | 
					  \question Calculate the factorial of 5: The factorial of a number
 | 
				
			||||||
 | 
					  $n$ is defined as the product of all integer numbers ranging from 1
 | 
				
			||||||
 | 
					  to $n$.  $\displaystyle{n! = 1 \cdot 2 \cdot 3 \cdot ... n =
 | 
				
			||||||
 | 
					    \prod_{k=1}^{n} k}$. We will calculate $5!$ in individual steps.
 | 
				
			||||||
  \begin{parts}
 | 
					  \begin{parts}
 | 
				
			||||||
    \part Create a variable \code{x} an assign the value 1.
 | 
					    \part Create a variable \code{x} an assign the value 1.
 | 
				
			||||||
    \part In a first step multiply \code{x} with 2 and assign the result to \code{x} itself. 
 | 
					    \part In a first step multiply \code{x} with 2 and reassign the result to \code{x}.
 | 
				
			||||||
    \part Proceed in a similar manner until x stores $5!$.
 | 
					    \part Proceed in a similar manner until x stores $5!$.
 | 
				
			||||||
  \end{parts}
 | 
					  \end{parts}
 | 
				
			||||||
  \begin{solution}
 | 
					  \begin{solution}
 | 
				
			||||||
    \code{x = 1;} \\ \code{x = x * 2;}\\ \code{x = x * 3;} \\ \code{x = x * 4;} \\ \code{x = x * 5;}\\ \code{disp(x)}\\
 | 
					    \code{x = 1;} \\ \code{x = x * 2;}\\ \code{x = x * 3;} \\ \code{x
 | 
				
			||||||
    \code{  120}
 | 
					      = x * 4;} \\ \code{x = x * 5;}\\ \code{disp(x)}\\ \code{ 120}
 | 
				
			||||||
  \end{solution}
 | 
					  \end{solution}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  \question Create a variable and assign a string to it. What is the data type of that variable?
 | 
					  \question Create a variable and assign a string to it. What is the data type of that variable?
 | 
				
			||||||
@ -126,7 +129,7 @@ executable on its own. The file should be named according to the following patte
 | 
				
			|||||||
  \code{x = 'some text'}\\ \code{class(x)\\ char}
 | 
					  \code{x = 'some text'}\\ \code{class(x)\\ char}
 | 
				
			||||||
  \end{solution}
 | 
					  \end{solution}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  \question List the largest numbers that can stored in 8, 16, 32
 | 
					  \question List the largest numbers that can be stored in 8, 16, 32
 | 
				
			||||||
  and 64 bit integer data types?
 | 
					  and 64 bit integer data types?
 | 
				
			||||||
  \begin{solution}
 | 
					  \begin{solution}
 | 
				
			||||||
    \verb+2^8 / 2 - 1+\\
 | 
					    \verb+2^8 / 2 - 1+\\
 | 
				
			||||||
@ -143,13 +146,14 @@ executable on its own. The file should be named according to the following patte
 | 
				
			|||||||
    The int8 dtype can only store values between -128 and 127.
 | 
					    The int8 dtype can only store values between -128 and 127.
 | 
				
			||||||
  \end{solution}
 | 
					  \end{solution}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  \question Explain the output of the follwoing commands: \code{int8(1024)} and \code{uint8(1024)}.
 | 
					  \question Explain the output of the following commands:
 | 
				
			||||||
 | 
					  \code{int8(1024)} and \code{uint8(1024)}.
 | 
				
			||||||
  \begin{solution}
 | 
					  \begin{solution}
 | 
				
			||||||
    int8 can store values between -128 and 127. uint8 is
 | 
					    int8 can store values between -128 and 127. uint8 is
 | 
				
			||||||
    \textit{unsigned}, ist stores values between 0 and 255.
 | 
					    \textit{unsigned}, it stores values between 0 and 255.
 | 
				
			||||||
  \end{solution}
 | 
					  \end{solution}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  \question Typeconversion:
 | 
					  \question Conversion of data types:
 | 
				
			||||||
  \begin{parts}
 | 
					  \begin{parts}
 | 
				
			||||||
    \part Execute: \code{x = 131.333}. What is the datatype of \code{x}?
 | 
					    \part Execute: \code{x = 131.333}. What is the datatype of \code{x}?
 | 
				
			||||||
    \begin{solution}
 | 
					    \begin{solution}
 | 
				
			||||||
@ -178,7 +182,7 @@ executable on its own. The file should be named according to the following patte
 | 
				
			|||||||
    \end{solution}
 | 
					    \end{solution}
 | 
				
			||||||
    \part Create a third variable \code{c} and assign \code{a+1e-16}. What is the result of \code{c-a}? Why?
 | 
					    \part Create a third variable \code{c} and assign \code{a+1e-16}. What is the result of \code{c-a}? Why?
 | 
				
			||||||
    \begin{solution}
 | 
					    \begin{solution}
 | 
				
			||||||
      Result is 0! Also with doubles there is a limited precision in
 | 
					      Result is 0! Even with doubles there is a limited precision in
 | 
				
			||||||
      the decimal part.
 | 
					      the decimal part.
 | 
				
			||||||
    \end{solution}
 | 
					    \end{solution}
 | 
				
			||||||
    \part Calculate \verb=(2^52 + 1) - 2^52= and
 | 
					    \part Calculate \verb=(2^52 + 1) - 2^52= and
 | 
				
			||||||
@ -192,7 +196,7 @@ executable on its own. The file should be named according to the following patte
 | 
				
			|||||||
      Square root of something larger than 1 should not be 1 and thus
 | 
					      Square root of something larger than 1 should not be 1 and thus
 | 
				
			||||||
      the result must not be 0.
 | 
					      the result must not be 0.
 | 
				
			||||||
    \end{solution}
 | 
					    \end{solution}
 | 
				
			||||||
    \part Compare wwith the result when adding a slightly largern number (e.g. 1e-8).
 | 
					    \part Try adding a slightly larger number (e.g. 1e-8). What happens?
 | 
				
			||||||
    \begin{solution}
 | 
					    \begin{solution}
 | 
				
			||||||
      Result is not equal to zero.
 | 
					      Result is not equal to zero.
 | 
				
			||||||
    \end{solution}
 | 
					    \end{solution}
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
\documentclass[12pt,a4paper,pdftex, answers]{exam}
 | 
					\documentclass[12pt,a4paper,pdftex]{exam}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\usepackage[german]{babel}
 | 
					\usepackage[german]{babel}
 | 
				
			||||||
\usepackage{natbib}
 | 
					\usepackage{natbib}
 | 
				
			||||||
@ -14,7 +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}
 | 
					\pagestyle{headandfoot}
 | 
				
			||||||
\header{{\bfseries\large Exercise 2}}{{\bfseries\large Vectors}}{{\bfseries\large 18. Oktober, 2017}}
 | 
					\header{{\bfseries\large Exercise 2}}{{\bfseries\large Vectors}}{{\bfseries\large 17. Oktober, 2018}}
 | 
				
			||||||
\firstpagefooter{Dr. Jan Grewe}{Phone: 29 74588}{Email:
 | 
					\firstpagefooter{Dr. Jan Grewe}{Phone: 29 74588}{Email:
 | 
				
			||||||
  jan.grewe@uni-tuebingen.de}
 | 
					  jan.grewe@uni-tuebingen.de}
 | 
				
			||||||
\runningfooter{}{\thepage}{}
 | 
					\runningfooter{}{\thepage}{}
 | 
				
			||||||
@ -36,16 +36,16 @@
 | 
				
			|||||||
         Neuroethology \hfill --- \hfill Institute for Neurobiology \hfill --- \hfill \includegraphics[width=0.28\textwidth]{UT_WBMW_Black_RGB} \\
 | 
					         Neuroethology \hfill --- \hfill Institute for Neurobiology \hfill --- \hfill \includegraphics[width=0.28\textwidth]{UT_WBMW_Black_RGB} \\
 | 
				
			||||||
\end{center}
 | 
					\end{center}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The exercises are meant for self-monitoring and revision of the lecture
 | 
					The exercises are meant for self-monitoring and revision of the
 | 
				
			||||||
topic. You should try to solve them on your own. Your solution should
 | 
					lecture. You should try to solve them on your own. Your solution
 | 
				
			||||||
be submitted as a single script (m-file) in the Ilias system. Each
 | 
					should be submitted as a single script (m-file) in the Ilias
 | 
				
			||||||
task should be solved in its own ``cell''. Each cell must be
 | 
					system. Each task should be solved in its own ``cell''. Each cell must
 | 
				
			||||||
executable on its own. The file should be named according to the following pattern:
 | 
					be executable on its own. The file should be named according to the
 | 
				
			||||||
``variables\_datatypes\_\{lastname\}.m'' benannt werden
 | 
					following pattern: ``variables\_datatypes\_\{lastname\}.m''
 | 
				
			||||||
(e.g. variables\_datentypes\_mueller.m).
 | 
					(e.g. vectors\_mueller.m).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{questions}
 | 
					\begin{questions}
 | 
				
			||||||
  \question Create vector with the following contents:
 | 
					  \question Create vectors with the following contents:
 | 
				
			||||||
  \begin{parts}
 | 
					  \begin{parts}
 | 
				
			||||||
    \part Integer numbers ranging from 1 to 10.
 | 
					    \part Integer numbers ranging from 1 to 10.
 | 
				
			||||||
    \begin{solution}
 | 
					    \begin{solution}
 | 
				
			||||||
@ -74,7 +74,7 @@ executable on its own. The file should be named according to the following patte
 | 
				
			|||||||
    \end{solution}
 | 
					    \end{solution}
 | 
				
			||||||
  \end{parts}
 | 
					  \end{parts}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  \question Calculations with vectors:
 | 
					  \question Calculating with vectors:
 | 
				
			||||||
  \begin{parts}
 | 
					  \begin{parts}
 | 
				
			||||||
    \part Create a vector \code{x = [3 2 6 8];}
 | 
					    \part Create a vector \code{x = [3 2 6 8];}
 | 
				
			||||||
    \part What is the size of this vector? Use the functions \code{size} and \code{length}. What is the difference between them?
 | 
					    \part What is the size of this vector? Use the functions \code{size} and \code{length}. What is the difference between them?
 | 
				
			||||||
@ -90,7 +90,7 @@ executable on its own. The file should be named according to the following patte
 | 
				
			|||||||
    \begin{solution}
 | 
					    \begin{solution}
 | 
				
			||||||
      \code{disp(x + 5)}
 | 
					      \code{disp(x + 5)}
 | 
				
			||||||
    \end{solution}
 | 
					    \end{solution}
 | 
				
			||||||
    \part Multiply each element of \code{x} with 2;
 | 
					    \part Multiply each element of \code{x} by 2;
 | 
				
			||||||
    \begin{solution}
 | 
					    \begin{solution}
 | 
				
			||||||
      \code{disp(x * 2)}
 | 
					      \code{disp(x * 2)}
 | 
				
			||||||
    \end{solution}
 | 
					    \end{solution}
 | 
				
			||||||
@ -189,7 +189,7 @@ executable on its own. The file should be named according to the following patte
 | 
				
			|||||||
    \end{solution}
 | 
					    \end{solution}
 | 
				
			||||||
  \end{parts}
 | 
					  \end{parts}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  \question Store some text in a valriable. The text should consist of at least two words (e.g. \code{x = 'some
 | 
					  \question Store some text in a variable. The text should consist of at least two words (e.g. \code{x = 'some
 | 
				
			||||||
    text'}). Use indexing to print out the words individually.
 | 
					    text'}). Use indexing to print out the words individually.
 | 
				
			||||||
  \begin{solution}
 | 
					  \begin{solution}
 | 
				
			||||||
    \code{x = 'some text'; \\ disp(x(1:4))\\disp(x(6:end))}
 | 
					    \code{x = 'some text'; \\ disp(x(1:4))\\disp(x(6:end))}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user