diff --git a/Lectures_my/NumMet/Lecture1/Examples/ex1/ex1.cc b/Lectures_my/NumMet/Lecture1/Examples/ex1/ex1.cc index 8c51c81..82364cd 100644 --- a/Lectures_my/NumMet/Lecture1/Examples/ex1/ex1.cc +++ b/Lectures_my/NumMet/Lecture1/Examples/ex1/ex1.cc @@ -83,13 +83,13 @@ for(int i=1;i<=number;++i) { - cout<>} -\pgfsyspdfmark {pgfid50}{23867907}{17900937} +\pgfsyspdfmark {pgfid47}{23867907}{17900937} \@writefile{nav}{\headcommand {\slideentry {0}{0}{11}{13/13}{}{0}}} \@writefile{nav}{\headcommand {\beamer@framepages {13}{13}}} -\pgfsyspdfmark {pgfid51}{0}{0} -\pgfsyspdfmark {pgfid52}{0}{0} +\pgfsyspdfmark {pgfid48}{0}{0} +\pgfsyspdfmark {pgfid49}{0}{0} \HyPL@Entry{13<>} \pgfsyspdfmark {pgfid53}{23867907}{17900937} \@writefile{nav}{\headcommand {\slideentry {0}{0}{12}{14/14}{}{0}}} @@ -118,11 +118,11 @@ \pgfsyspdfmark {pgfid60}{0}{0} \pgfsyspdfmark {pgfid61}{0}{0} \HyPL@Entry{16<>} -\pgfsyspdfmark {pgfid71}{23867907}{17900937} +\pgfsyspdfmark {pgfid62}{23867907}{17900937} \@writefile{nav}{\headcommand {\slideentry {0}{0}{15}{17/17}{}{0}}} \@writefile{nav}{\headcommand {\beamer@framepages {17}{17}}} -\pgfsyspdfmark {pgfid72}{0}{0} -\pgfsyspdfmark {pgfid73}{0}{0} +\pgfsyspdfmark {pgfid63}{0}{0} +\pgfsyspdfmark {pgfid64}{0}{0} \HyPL@Entry{17<>} \pgfsyspdfmark {pgfid74}{23867907}{17900937} \@writefile{nav}{\headcommand {\slideentry {0}{0}{16}{18/18}{}{0}}} @@ -153,8 +153,14 @@ \@writefile{nav}{\headcommand {\beamer@framepages {22}{22}}} \pgfsyspdfmark {pgfid87}{0}{0} \pgfsyspdfmark {pgfid88}{0}{0} -\@writefile{nav}{\headcommand {\beamer@partpages {1}{22}}} -\@writefile{nav}{\headcommand {\beamer@subsectionpages {1}{22}}} -\@writefile{nav}{\headcommand {\beamer@sectionpages {1}{22}}} -\@writefile{nav}{\headcommand {\beamer@documentpages {22}}} -\@writefile{nav}{\headcommand {\def \inserttotalframenumber {19}}} +\HyPL@Entry{22<>} +\pgfsyspdfmark {pgfid89}{23867907}{17900937} +\@writefile{nav}{\headcommand {\slideentry {0}{0}{21}{23/23}{}{0}}} +\@writefile{nav}{\headcommand {\beamer@framepages {23}{23}}} +\pgfsyspdfmark {pgfid90}{0}{0} +\pgfsyspdfmark {pgfid91}{0}{0} +\@writefile{nav}{\headcommand {\beamer@partpages {1}{23}}} +\@writefile{nav}{\headcommand {\beamer@subsectionpages {1}{23}}} +\@writefile{nav}{\headcommand {\beamer@sectionpages {1}{23}}} +\@writefile{nav}{\headcommand {\beamer@documentpages {23}}} +\@writefile{nav}{\headcommand {\def \inserttotalframenumber {20}}} diff --git a/Lectures_my/NumMet/Lecture1/mchrzasz.log b/Lectures_my/NumMet/Lecture1/mchrzasz.log index 3068287..f0cd974 100644 --- a/Lectures_my/NumMet/Lecture1/mchrzasz.log +++ b/Lectures_my/NumMet/Lecture1/mchrzasz.log @@ -1,4 +1,4 @@ -This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Debian) (format=xelatex 2015.4.1) 30 AUG 2016 18:45 +This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Debian) (format=xelatex 2015.4.1) 5 SEP 2016 11:47 entering extended mode restricted \write18 enabled. %&-line parsing enabled. @@ -2748,14 +2748,9 @@ ] LaTeX Font Info: External font `plex10' loaded for size -(Font) <9> on input line 303. +(Font) <9> on input line 299. -Overfull \hbox (12.79086pt too wide) detected at line 303 -\OT4/cmr/m/n/9 mark = [] - [] - - -Overfull \hbox (8.33818pt too wide) in paragraph at lines 303--303 +Overfull \hbox (8.33818pt too wide) in paragraph at lines 299--299 [][] [] @@ -2866,7 +2861,7 @@ ] File: images/pen.jpg Graphic file (type QTm) -Overfull \vbox (5.33316pt too high) detected at line 380 +Overfull \vbox (5.33316pt too high) detected at line 376 [] File: images/BG_lower.png Graphic file (type QTm) @@ -2957,6 +2952,14 @@ [11 ] +LaTeX Font Info: Try loading font information for EU1+lmtt on input line 447 +. + (/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1lmtt.fd +File: eu1lmtt.fd 2009/10/30 v1.6 Font defs for Latin Modern +) +File: images/joke.jpg Graphic file (type QTm) + + File: images/BG_lower.png Graphic file (type QTm) Overfull \vbox (19.18185pt too high) has occurred while \output is active [] @@ -2978,8 +2981,6 @@ [12 ] -LaTeX Font Info: External font `plex10' loaded for size -(Font) <12> on input line 478. File: images/BG_lower.png Graphic file (type QTm) Overfull \vbox (19.18185pt too high) has occurred while \output is active [] @@ -3001,16 +3002,14 @@ [13 ] -LaTeX Font Info: Try loading font information for EU1+lmtt on input line 495 -. - (/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1lmtt.fd -File: eu1lmtt.fd 2009/10/30 v1.6 Font defs for Latin Modern -) -File: images/table.png Graphic file (type QTm) +LaTeX Font Info: External font `plex10' loaded for size +(Font) <12> on input line 501. - +Overfull \vbox (0.43752pt too high) detected at line 501 + [] + File: images/BG_lower.png Graphic file (type QTm) - + Overfull \vbox (19.18185pt too high) has occurred while \output is active [] ................................................. @@ -3030,6 +3029,8 @@ [14 ] +File: images/table.png Graphic file (type QTm) + File: images/BG_lower.png Graphic file (type QTm) Overfull \vbox (19.18185pt too high) has occurred while \output is active [] @@ -3114,6 +3115,27 @@ [18 ] +File: images/BG_lower.png Graphic file (type QTm) + +Overfull \vbox (19.18185pt too high) has occurred while \output is active [] + +................................................. +. fontspec info: "no-scripts" +. +. Font Trebuchet MS does not contain any OpenType `Script' information. +................................................. +................................................. +. fontspec info: "defining-font" +. +. Font family 'TrebuchetMS(0)' created for font 'Trebuchet MS' with options +. [Mapping=tex-text,]. +. +. This font family consists of the following shapes: +................................................. + +[19 + +] File: images/ex1.png Graphic file (type QTm) File: images/BG_lower.png Graphic file (type QTm) @@ -3134,7 +3156,7 @@ . This font family consists of the following shapes: ................................................. -[19 +[20 ] File: images/ex2.png Graphic file (type QTm) @@ -3157,31 +3179,9 @@ . This font family consists of the following shapes: ................................................. -[20 - -] -File: images/BG_lower.png Graphic file (type QTm) - -Overfull \vbox (19.18185pt too high) has occurred while \output is active [] - -................................................. -. fontspec info: "no-scripts" -. -. Font Trebuchet MS does not contain any OpenType `Script' information. -................................................. -................................................. -. fontspec info: "defining-font" -. -. Font family 'TrebuchetMS(0)' created for font 'Trebuchet MS' with options -. [Mapping=tex-text,]. -. -. This font family consists of the following shapes: -................................................. - [21 ] -\c@framenumberappendix=\count443 File: images/BG_lower.png Graphic file (type QTm) Overfull \vbox (19.18185pt too high) has occurred while \output is active [] @@ -3203,6 +3203,28 @@ [22 ] +\c@framenumberappendix=\count443 +File: images/BG_lower.png Graphic file (type QTm) + +Overfull \vbox (19.18185pt too high) has occurred while \output is active [] + +................................................. +. fontspec info: "no-scripts" +. +. Font Trebuchet MS does not contain any OpenType `Script' information. +................................................. +................................................. +. fontspec info: "defining-font" +. +. Font family 'TrebuchetMS(0)' created for font 'Trebuchet MS' with options +. [Mapping=tex-text,]. +. +. This font family consists of the following shapes: +................................................. + +[23 + +] \tf@nav=\write10 \openout10 = `mchrzasz.nav'. @@ -3212,23 +3234,23 @@ \tf@snm=\write12 \openout12 = `mchrzasz.snm'. -Package atveryend Info: Empty hook `BeforeClearDocument' on input line 634. -Package atveryend Info: Empty hook `AfterLastShipout' on input line 634. +Package atveryend Info: Empty hook `BeforeClearDocument' on input line 657. +Package atveryend Info: Empty hook `AfterLastShipout' on input line 657. (./mchrzasz.aux) -Package atveryend Info: Empty hook `AtVeryEndDocument' on input line 634. -Package atveryend Info: Empty hook `AtEndAfterFileList' on input line 634. +Package atveryend Info: Empty hook `AtVeryEndDocument' on input line 657. +Package atveryend Info: Empty hook `AtEndAfterFileList' on input line 657. Package logreq Info: Writing requests to 'mchrzasz.run.xml'. \openout1 = `mchrzasz.run.xml'. -Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 634. +Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 657. ) Here is how much of TeX's memory you used: - 48494 strings out of 493918 - 953147 string characters out of 6150564 + 48501 strings out of 493918 + 953270 string characters out of 6150564 1288912 words of memory out of 5000000 - 50770 multiletter control sequences out of 15000+600000 + 50776 multiletter control sequences out of 15000+600000 37184 words of font info for 148 fonts, out of 8000000 for 9000 1144 hyphenation exceptions out of 8191 - 61i,17n,73p,10479b,1483s stack positions out of 5000i,500n,10000p,200000b,80000s + 61i,17n,73p,10479b,1486s stack positions out of 5000i,500n,10000p,200000b,80000s -Output written on mchrzasz.pdf (22 pages). +Output written on mchrzasz.pdf (23 pages). diff --git a/Lectures_my/NumMet/Lecture1/mchrzasz.nav b/Lectures_my/NumMet/Lecture1/mchrzasz.nav index 4a1ebc6..c82e609 100644 --- a/Lectures_my/NumMet/Lecture1/mchrzasz.nav +++ b/Lectures_my/NumMet/Lecture1/mchrzasz.nav @@ -40,8 +40,10 @@ \headcommand {\beamer@framepages {21}{21}} \headcommand {\slideentry {0}{0}{20}{22/22}{}{0}} \headcommand {\beamer@framepages {22}{22}} -\headcommand {\beamer@partpages {1}{22}} -\headcommand {\beamer@subsectionpages {1}{22}} -\headcommand {\beamer@sectionpages {1}{22}} -\headcommand {\beamer@documentpages {22}} -\headcommand {\def \inserttotalframenumber {19}} +\headcommand {\slideentry {0}{0}{21}{23/23}{}{0}} +\headcommand {\beamer@framepages {23}{23}} +\headcommand {\beamer@partpages {1}{23}} +\headcommand {\beamer@subsectionpages {1}{23}} +\headcommand {\beamer@sectionpages {1}{23}} +\headcommand {\beamer@documentpages {23}} +\headcommand {\def \inserttotalframenumber {20}} diff --git a/Lectures_my/NumMet/Lecture1/mchrzasz.pdf b/Lectures_my/NumMet/Lecture1/mchrzasz.pdf index b52b491..4496eeb 100644 --- a/Lectures_my/NumMet/Lecture1/mchrzasz.pdf +++ b/Lectures_my/NumMet/Lecture1/mchrzasz.pdf Binary files differ diff --git a/Lectures_my/NumMet/Lecture1/mchrzasz.synctex.gz b/Lectures_my/NumMet/Lecture1/mchrzasz.synctex.gz index a65e95f..333339f 100644 --- a/Lectures_my/NumMet/Lecture1/mchrzasz.synctex.gz +++ b/Lectures_my/NumMet/Lecture1/mchrzasz.synctex.gz Binary files differ diff --git a/Lectures_my/NumMet/Lecture1/mchrzasz.tex b/Lectures_my/NumMet/Lecture1/mchrzasz.tex index 412d1ce..bb7391b 100644 --- a/Lectures_my/NumMet/Lecture1/mchrzasz.tex +++ b/Lectures_my/NumMet/Lecture1/mchrzasz.tex @@ -258,25 +258,20 @@ \end{frame} \begin{frame}\frametitle{Course plan} +\begin{small} +\ARROW The course consists of 2 hours lecture and 2 hours of exercise.\\ +\ARROW TA will explain to you how you will get points for the class exercise (you will be coding the algorithms) described on the lecture and applying them to some problems.\\ +\ARROW After passing the class exercise ($>66\%$ of points) you will have an exam (oral).\\ -\ARROW On each lecture there will be set of problem (standard) to code and solve.\\ -\ARROW For each of them you will get points: -\begin{itemize} -\item 6 points if solved within 2 weeks. -\item 5 points if solved within 3 weeks. -\item 4 points if solved within 4 weeks. -\item 3 points if solved within 5 weeks. -\item etc. -\end{itemize} -\ARROW {\color{red}{There will be points for additional problems.}}\\ + \begin{columns} \column{0.7\textwidth} \ARROW The final mark: \vspace{0.1cm} \begin{footnotesize} -\begin{equation} -\rm mark= \dfrac{\sum received~points~standard + \sum additional~points}{\sum points~standard} \nonumber -\end{equation} +\begin{equation*} +{\rm mark}= 0.5~ {\rm exam} + 0.5 ~ {\rm class} +\end{equation*} \ARROW The final exam will be average of exam and class marks. \end{footnotesize} \column{0.05\textwidth} @@ -300,6 +295,7 @@ \end{columns} +\end{small} \end{frame} \begin{frame}\frametitle{Course plan} @@ -423,9 +419,36 @@ \end{frame} +\begin{frame}\frametitle{Integer numbers on our PC} +\begin{small} +\ARROW The integer numbers are very easy to represent on PC: +\begin{align*} +a=\pm (c_1N^0 + c_2N^1 +...+ c_dN^{d-1}), +\end{align*} +where $N$ is the base of the system. Computers of course use $2$. +\begin{columns} +\column{3in} +\ARROW For example: +\begin{align*} +101011 \rightleftarrows & 1 \cdot 2^0 + 1 \cdot 2^1 +0 \cdot 2^2 + 1 \cdot 2^3 +\\ & 0 \cdot 2^4 +1 \cdot 2^5\\ & = 43 +\end{align*} +\ARROW Now the first bit can be used for sign determination ($0$ plus $1$ minus) \texttt{int} or can be used to extend the range of numbers \texttt{unsigned}\\ +\ARROW \texttt{int} - $-2147483648 - 2147483647$\\ +\ARROW \texttt{unsigned} - $0 - 4294967295$ -\begin{frame}\frametitle{Numbers on our PC} +\column{2in} +\includegraphics[width=0.95\textwidth]{images/joke.jpg} + +\end{columns} + +\end{small} + +\end{frame} + + + +\begin{frame}\frametitle{Floating numbers on our PC} \begin{small} \ARROW Computers are using so-called ''classical floating point representation'': \begin{align*} @@ -434,13 +457,13 @@ \begin{itemize} \item $M$ - mantissa or significand \item $N$ - base of the system -\item $C$ - characteristic +\item $C$ - exponent \end{itemize} \ARROW In such system the mantissa is always normalized: \begin{align*} M \in \left[ \frac{1}{N}, 1 \right) \end{align*} -\ARROW Using the definition we can write the mantissa and characteristic in the following way: +\ARROW Using the definition we can write the mantissa and exponent in the following way: \begin{align*} M=(m_1N^{-1}+m_2N^{-2}+...+m_t N^t)\\ C=\pm(c_1 N^0+ c_2 N^1 + c_3 N^2 + ...+c_d N^{d-1}) @@ -454,17 +477,17 @@ \begin{small} \ARROW For example let's construct numbers using binary system: \begin{align*} -M=(m_1 2^{-1}+m_2 2^{-2}+...+m_t 2^t)\\ +M=\pm(m_1 2^{-1}+m_2 2^{-2}+...+m_t 2^t)\\ C=\pm(c_1 2^0+ c_2 2^1 + c_3 2^2 + ...+c_d 2^{d-1}) \end{align*} where: \begin{itemize} -\item $t$ - length of mantissa, $d$ - length of characteristic +\item $t$ - length of mantissa, $d$ - length of exponent \item $m_i$ - mantissa digits; $m_i \in \lbrace 0,1\rbrace$ -\item $c_i$ - characteristics digits; $c_i \in \lbrace 0,1\rbrace$ +\item $c_i$ - exponent digits; $c_i \in \lbrace 0,1\rbrace$ \end{itemize} \begin{exampleblock}{Example: $11110001~(s)mmmm(s)cc$} -Lets say we are representing a number with a byte. First 5 digits are the mantissa the next 3 are characteristic. +Lets say we are representing a number with a byte. First 5 digits are the mantissa the next 3 are exponent. \begin{align*} M=-(1 \cdot 2^{-1} + 1 \cdot 2^{-2} + 1 \cdot 2^{-3} + 0 \cdot 2^{-4} = -\frac{7}{8}\\ C= + (0 \cdot 2^0 + 1 \cdot 2^1)=2\\ @@ -504,7 +527,7 @@ \end{align*} \ARROW If each of the $\epsilon_i$ numbers have a constant distribution on $\left[-\frac{1}{2} 10^{-d}, \frac{1}{2} 10^{-d} \right]$, where $d$ is the precision.\\ \ARROW Then $\epsilon$ has a triangular distribution on $\left[-10^{-d}, 10^{-d} \right]$\\ -\ARROW Repeating many times this we will approach the Gaussian distribution with a width of $\sim \sqrt{N} 10^{-d}$ +\ARROW Repeating $N$ times this we will approach the Gaussian distribution with a width of $\sim \sqrt{N} 10^{-d}$ \end{small} @@ -514,11 +537,11 @@ \begin{small} \ARROW Let's consider we have two numbers $x$ and $y$. \\ \ARROW Their representation are not exact so: $x=\overline{x} + \epsilon_x$ and $y=\overline{y}+\epsilon_y$\\ -\ARROW Now if we want to multiply them: +\ARROW Now if we want to multiply them (we can neglect $\epsilon_x \epsilon_y$ terms): \begin{align*} x \cdot y=\overline{x} \cdot \overline{y} + \epsilon_x \cdot \overline{y}+\epsilon_y \cdot \overline{x} \end{align*} -\ARROW If $\vert \overline{x} \vert \gg (\ll) \vert \overline{y}$ then the error might explode. \\ +\ARROW If $\vert \overline{x} \vert \gg (\ll) \vert \overline{y} \vert$ then the error might explode. \\ \ARROW Now if we want to divide them: \begin{align*} @@ -541,7 +564,7 @@ \begin{alertblock}{Backward stability} Backward stability means that our algorithm will gives us the true answer if we move to infinite precision of the machine. In practice we look if we can conserve the errors of the representation. \end{alertblock} -\begin{exampleblock}{Well defined} +\begin{exampleblock}{Well-posed} Each algorithm has some input parameters. If we introduce a slight difference in those parameters (of the order of the representation precision), the results should not change significantly. \end{exampleblock}