aboutsummaryrefslogtreecommitdiffstats
path: root/buch/chapters/040-rekursion/images
diff options
context:
space:
mode:
authorNicolas Tobler <nicolas.tobler@ost.ch>2022-05-30 00:06:46 +0200
committerNicolas Tobler <nicolas.tobler@ost.ch>2022-05-30 00:06:46 +0200
commit65a3fc106c36dfd1750f8caf8b3d1b5fb0fe71f9 (patch)
tree30791dc17973690a6d761589de357c452ba9fa29 /buch/chapters/040-rekursion/images
parentAdded content, presentation (diff)
parentbeispiel korrektur (diff)
downloadSeminarSpezielleFunktionen-65a3fc106c36dfd1750f8caf8b3d1b5fb0fe71f9.tar.gz
SeminarSpezielleFunktionen-65a3fc106c36dfd1750f8caf8b3d1b5fb0fe71f9.zip
Merge branch 'master' of https://github.com/AndreasFMueller/SeminarSpezielleFunktionen
Diffstat (limited to '')
-rw-r--r--buch/chapters/040-rekursion/images/Makefile16
-rw-r--r--buch/chapters/040-rekursion/images/beta.pdfbin0 -> 109772 bytes
-rw-r--r--buch/chapters/040-rekursion/images/beta.tex236
-rw-r--r--buch/chapters/040-rekursion/images/betadist.m58
-rw-r--r--buch/chapters/040-rekursion/images/order.m119
-rw-r--r--buch/chapters/040-rekursion/images/order.pdfbin0 -> 32692 bytes
-rw-r--r--buch/chapters/040-rekursion/images/order.tex125
7 files changed, 553 insertions, 1 deletions
diff --git a/buch/chapters/040-rekursion/images/Makefile b/buch/chapters/040-rekursion/images/Makefile
index 9608a94..86dfa1e 100644
--- a/buch/chapters/040-rekursion/images/Makefile
+++ b/buch/chapters/040-rekursion/images/Makefile
@@ -3,7 +3,7 @@
#
# (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
#
-all: gammaplot.pdf fibonacci.pdf
+all: gammaplot.pdf fibonacci.pdf order.pdf beta.pdf
gammaplot.pdf: gammaplot.tex gammapaths.tex
pdflatex gammaplot.tex
@@ -16,3 +16,17 @@ fibonaccigrid.tex: fibonacci.m
fibonacci.pdf: fibonacci.tex fibonaccigrid.tex
pdflatex fibonacci.tex
+
+order.pdf: order.tex orderpath.tex
+ pdflatex order.tex
+
+orderpath.tex: order.m
+ octave order.m
+
+beta.pdf: beta.tex betapaths.tex
+ pdflatex beta.tex
+
+betapaths.tex: betadist.m
+ octave betadist.m
+
+
diff --git a/buch/chapters/040-rekursion/images/beta.pdf b/buch/chapters/040-rekursion/images/beta.pdf
new file mode 100644
index 0000000..0e6567b
--- /dev/null
+++ b/buch/chapters/040-rekursion/images/beta.pdf
Binary files differ
diff --git a/buch/chapters/040-rekursion/images/beta.tex b/buch/chapters/040-rekursion/images/beta.tex
new file mode 100644
index 0000000..1e1a1b3
--- /dev/null
+++ b/buch/chapters/040-rekursion/images/beta.tex
@@ -0,0 +1,236 @@
+%
+% beta.tex -- display some symmetric beta distributions
+%
+% (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
+%
+\documentclass[tikz]{standalone}
+\usepackage{amsmath}
+\usepackage{times}
+\usepackage{txfonts}
+\usepackage{pgfplots}
+\usepackage{csvsimple}
+\usetikzlibrary{arrows,intersections,math,calc}
+\input{betapaths.tex}
+\begin{document}
+\def\skala{12}
+\definecolor{colorone}{rgb}{1.0,0.6,0.0}
+\definecolor{colortwo}{rgb}{1.0,0.0,0.0}
+\definecolor{colorthree}{rgb}{0.6,0.0,0.6}
+\definecolor{colorfour}{rgb}{0.6,0.0,1.0}
+\definecolor{colorfive}{rgb}{0.0,0.0,1.0}
+\definecolor{colorsix}{rgb}{0.4,0.6,1.0}
+\definecolor{colorseven}{rgb}{0.0,0.0,0.0}
+\definecolor{coloreight}{rgb}{0.0,0.8,0.8}
+\definecolor{colornine}{rgb}{0.0,0.8,0.2}
+\definecolor{colorten}{rgb}{0.2,0.4,0.0}
+\definecolor{coloreleven}{rgb}{0.6,1.0,0.0}
+\definecolor{colortwelve}{rgb}{1.0,0.8,0.4}
+
+\def\achsen{
+ \foreach \x in {0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9}{
+ \draw ({\x*\dx},{-0.1/\skala}) -- ({\x*\dx},{0.1/\skala});
+ \node at ({\x*\dx},{-0.1/\skala}) [below] {$\x$};
+ }
+ \foreach \y in {1,2,3,4}{
+ \draw ({-0.1/\skala},{\y*\dy}) -- ({0.1/\skala},{\y*\dy});
+ \node at ({-0.1/\skala},{\y*\dy}) [left] {$\y$};
+ }
+ \def\x{1}
+ \draw ({\x*\dx},{-0.1/\skala}) -- ({\x*\dx},{0.1/\skala});
+ \node at ({\x*\dx},{-0.1/\skala}) [below] {$\x$};
+ \def\x{0}
+ \node at ({\x*\dx},{-0.1/\skala}) [below] {$\x$};
+
+ \draw[->] ({-0.1/\skala},0) -- ({1*\dx+0.4/\skala},0)
+ coordinate[label={$x$}];
+ \draw[->] (0,{-0.1/\skala}) -- (0,{\betamax*\dy+0.4/\skala},0)
+ coordinate[label={right:$\beta(a,b,x)$}];
+}
+
+\def\farbcoord#1#2{
+ ({\dx*(0.63+((#1)/5)*0.27)},{\dx*(0.18+((#2)/5)*0.27)})
+}
+\def\farbviereck{
+ \foreach \x in {1,2,3,4}{
+ \draw[color=gray!30] \farbcoord{\x}{0} -- \farbcoord{\x}{4};
+ \draw[color=gray!30] \farbcoord{0}{\x} -- \farbcoord{4}{\x};
+ }
+ \draw[->] \farbcoord{0}{0} -- \farbcoord{4.4}{0}
+ coordinate[label={$a$}];
+ \draw[->] \farbcoord{0}{0} -- \farbcoord{0}{4.4}
+ coordinate[label={left: $b$}];
+ \foreach \x in {1,2,3,4}{
+ \node[color=gray] at \farbcoord{4}{\x} [right] {\tiny $b=\x$};
+ %\fill[color=white,opacity=0.7]
+ % \farbcoord{(\x-0.1)}{3.3}
+ % rectangle
+ % \farbcoord{(\x+0.1)}{4};
+ \node[color=gray] at \farbcoord{\x}{4} [right,rotate=90]
+ {\tiny $a=\x$};
+ }
+}
+\def\farbpunkt#1#2#3{
+ \fill[color=#3] \farbcoord{#1}{#2} circle[radius={0.1/\skala}];
+}
+
+\begin{tikzpicture}[>=latex,thick,scale=\skala]
+
+\def\dx{1.15}
+\def\dy{0.1}
+\def\opa{0.1}
+
+\def\betamax{4.9}
+
+\begin{scope}
+\clip (0,0) rectangle ({1*\dx},{\betamax*\dy});
+\fill[color=colorone,opacity=\opa] (0,0) -- \betaaa -- (\dx,0) -- cycle;
+\fill[color=colortwo,opacity=\opa] (0,0) -- \betabb -- (\dx,0) -- cycle;
+\fill[color=colorthree,opacity=\opa] (0,0) -- \betacc -- (\dx,0) -- cycle;
+\fill[color=colorfour,opacity=\opa] (0,0) -- \betadd -- (\dx,0) -- cycle;
+\fill[color=colorfive,opacity=\opa] (0,0) -- \betaee -- (\dx,0) -- cycle;
+\fill[color=colorsix,opacity=\opa] (0,0) -- \betaff -- (\dx,0) -- cycle;
+\fill[color=colorseven,opacity=\opa] (0,0) -- \betagg -- (\dx,0) -- cycle;
+\fill[color=coloreight,opacity=\opa] (0,0) -- \betahh -- (\dx,0) -- cycle;
+\fill[color=colornine,opacity=\opa] (0,0) -- \betaii -- (\dx,0) -- cycle;
+\fill[color=colorten,opacity=\opa] (0,0) -- \betajj -- (\dx,0) -- cycle;
+\fill[color=coloreleven,opacity=\opa] (0,0) -- \betakk -- (\dx,0) -- cycle;
+\fill[color=colortwelve,opacity=\opa] (0,0) -- \betall -- (\dx,0) -- cycle;
+
+\draw[color=colorone] \betaaa;
+\draw[color=colortwo] \betabb;
+\draw[color=colorthree] \betacc;
+\draw[color=colorfour] \betadd;
+\draw[color=colorfive] \betaee;
+\draw[color=colorsix] \betaff;
+\draw[color=colorseven] \betagg;
+\draw[color=coloreight] \betahh;
+\draw[color=colornine] \betaii;
+\draw[color=colorten] \betajj;
+\draw[color=coloreleven] \betakk;
+\draw[color=colortwelve] \betall;
+
+\end{scope}
+
+\achsen
+
+\farbviereck
+
+\farbpunkt{\alphatwelve}{\betatwelve}{colortwelve}
+\farbpunkt{\alphaeleven}{\betaeleven}{coloreleven}
+\farbpunkt{\alphaten}{\betaten}{colorten}
+\farbpunkt{\alphanine}{\betanine}{colornine}
+\farbpunkt{\alphaeight}{\betaeight}{coloreight}
+\farbpunkt{\alphaseven}{\betaseven}{colorseven}
+\farbpunkt{\alphasix}{\betasix}{colorsix}
+\farbpunkt{\alphafive}{\betafive}{colorfive}
+\farbpunkt{\alphafour}{\betafour}{colorfour}
+\farbpunkt{\alphathree}{\betathree}{colorthree}
+\farbpunkt{\alphatwo}{\betatwo}{colortwo}
+\farbpunkt{\alphaone}{\betaone}{colorone}
+
+
+\def\betamax{4.9}
+
+\begin{scope}[yshift=-0.6cm]
+
+\begin{scope}
+\clip (0,0) rectangle ({1*\dx},{\betamax*\dy});
+\fill[color=colorone,opacity=\opa] (0,0) -- \betaea -- (\dx,0) -- cycle;
+\fill[color=colortwo,opacity=\opa] (0,0) -- \betaeb -- (\dx,0) -- cycle;
+\fill[color=colorthree,opacity=\opa] (0,0) -- \betaec -- (\dx,0) -- cycle;
+\fill[color=colorfour,opacity=\opa] (0,0) -- \betaed -- (\dx,0) -- cycle;
+\fill[color=colorfive,opacity=\opa] (0,0) -- \betaee -- (\dx,0) -- cycle;
+\fill[color=colorsix,opacity=\opa] (0,0) -- \betaef -- (\dx,0) -- cycle;
+\fill[color=colorseven,opacity=\opa] (0,0) -- \betaeg -- (\dx,0) -- cycle;
+\fill[color=coloreight,opacity=\opa] (0,0) -- \betaeh -- (\dx,0) -- cycle;
+\fill[color=colornine,opacity=\opa] (0,0) -- \betaei -- (\dx,0) -- cycle;
+\fill[color=colorten,opacity=\opa] (0,0) -- \betaej -- (\dx,0) -- cycle;
+\fill[color=coloreleven,opacity=\opa] (0,0) -- \betaek -- (\dx,0) -- cycle;
+\fill[color=colortwelve,opacity=\opa] (0,0) -- \betael -- (\dx,0) -- cycle;
+
+\draw[color=colorone] \betaea;
+\draw[color=colortwo] \betaeb;
+\draw[color=colorthree] \betaec;
+\draw[color=colorfour] \betaed;
+\draw[color=colorfive] \betaee;
+\draw[color=colorsix] \betaef;
+\draw[color=colorseven] \betaeg;
+\draw[color=coloreight] \betaeh;
+\draw[color=colornine] \betaei;
+\draw[color=colorten] \betaej;
+\draw[color=coloreleven] \betaek;
+\draw[color=colortwelve] \betael;
+\end{scope}
+
+\achsen
+
+\farbviereck
+
+\farbpunkt{\alphafive}{\betatwelve}{colortwelve}
+\farbpunkt{\alphafive}{\betaeleven}{coloreleven}
+\farbpunkt{\alphafive}{\betaten}{colorten}
+\farbpunkt{\alphafive}{\betanine}{colornine}
+\farbpunkt{\alphafive}{\betaeight}{coloreight}
+\farbpunkt{\alphafive}{\betaseven}{colorseven}
+\farbpunkt{\alphafive}{\betasix}{colorsix}
+\farbpunkt{\alphafive}{\betafive}{colorfive}
+\farbpunkt{\alphafive}{\betafour}{colorfour}
+\farbpunkt{\alphafive}{\betathree}{colorthree}
+\farbpunkt{\alphafive}{\betatwo}{colortwo}
+\farbpunkt{\alphafive}{\betaone}{colorone}
+
+\end{scope}
+
+\begin{scope}[yshift=-1.2cm]
+
+\begin{scope}
+\clip (0,0) rectangle ({1*\dx},{\betamax*\dy});
+\fill[color=colorone,opacity=\opa] (0,0) -- \betaal -- (\dx,0) -- cycle;
+\fill[color=colortwo,opacity=\opa] (0,0) -- \betabl -- (\dx,0) -- cycle;
+\fill[color=colorthree,opacity=\opa] (0,0) -- \betacl -- (\dx,0) -- cycle;
+\fill[color=colorfour,opacity=\opa] (0,0) -- \betadl -- (\dx,0) -- cycle;
+\fill[color=colorfive,opacity=\opa] (0,0) -- \betael -- (\dx,0) -- cycle;
+\fill[color=colorsix,opacity=\opa] (0,0) -- \betafl -- (\dx,0) -- cycle;
+\fill[color=colorseven,opacity=\opa] (0,0) -- \betagl -- (\dx,0) -- cycle;
+\fill[color=coloreight,opacity=\opa] (0,0) -- \betahl -- (\dx,0) -- cycle;
+\fill[color=colornine,opacity=\opa] (0,0) -- \betail -- (\dx,0) -- cycle;
+\fill[color=colorten,opacity=\opa] (0,0) -- \betajl -- (\dx,0) -- cycle;
+\fill[color=coloreleven,opacity=\opa] (0,0) -- \betakl -- (\dx,0) -- cycle;
+\fill[color=colortwelve,opacity=\opa] (0,0) -- \betall -- (\dx,0) -- cycle;
+
+\draw[color=colorone] \betaal;
+\draw[color=colortwo] \betabl;
+\draw[color=colorthree] \betacl;
+\draw[color=colorfour] \betadl;
+\draw[color=colorfive] \betael;
+\draw[color=colorsix] \betafl;
+\draw[color=colorseven] \betagl;
+\draw[color=coloreight] \betahl;
+\draw[color=colornine] \betail;
+\draw[color=colorten] \betajl;
+\draw[color=coloreleven] \betakl;
+\draw[color=colortwelve] \betall;
+\end{scope}
+
+\achsen
+
+\farbviereck
+
+\farbpunkt{\alphatwelve}{\betatwelve}{colortwelve}
+\farbpunkt{\alphaeleven}{\betatwelve}{coloreleven}
+\farbpunkt{\alphaten}{\betatwelve}{colorten}
+\farbpunkt{\alphanine}{\betatwelve}{colornine}
+\farbpunkt{\alphaeight}{\betatwelve}{coloreight}
+\farbpunkt{\alphaseven}{\betatwelve}{colorseven}
+\farbpunkt{\alphasix}{\betatwelve}{colorsix}
+\farbpunkt{\alphafive}{\betatwelve}{colorfive}
+\farbpunkt{\alphafour}{\betatwelve}{colorfour}
+\farbpunkt{\alphathree}{\betatwelve}{colorthree}
+\farbpunkt{\alphatwo}{\betatwelve}{colortwo}
+\farbpunkt{\alphaone}{\betatwelve}{colorone}
+
+\end{scope}
+
+\end{tikzpicture}
+\end{document}
+
diff --git a/buch/chapters/040-rekursion/images/betadist.m b/buch/chapters/040-rekursion/images/betadist.m
new file mode 100644
index 0000000..5b466a6
--- /dev/null
+++ b/buch/chapters/040-rekursion/images/betadist.m
@@ -0,0 +1,58 @@
+#
+# betadist.m
+#
+# (c) 2022 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
+#
+global N;
+N = 201;
+global nmin;
+global nmax;
+nmin = -4;
+nmax = 7;
+n = nmax - nmin + 1
+A = 3;
+
+t = (nmin:nmax) / nmax;
+alpha = 1 + A * t .* abs(t)
+#alpha(1) = 0.01;
+
+#alpha = [ 1, 1.03, 1.05, 1.1, 1.25, 1.5, 2, 2.5, 3, 4, 5 ];
+beta = alpha;
+names = [ "one"; "two"; "three"; "four"; "five"; "six"; "seven"; "eight";
+ "nine"; "ten"; "eleven"; "twelve" ]
+
+function retval = Beta(a, b, x)
+ retval = x^(a-1) * (1-x)^(b-1) / beta(a, b);
+ if (retval > 100)
+ retval = 100
+ end
+end
+
+function plotbeta(fn, a, b, name)
+ global N;
+ fprintf(fn, "\\def\\beta%s{\n", strtrim(name));
+ fprintf(fn, "\t({%.4f*\\dx},{%.4f*\\dy})", 0, Beta(a, b, 0));
+ for x = (1:N-1)/(N-1)
+ X = (1-cos(pi * x))/2;
+ fprintf(fn, "\n\t--({%.4f*\\dx},{%.4f*\\dy})",
+ X, Beta(a, b, X));
+ end
+ fprintf(fn, "\n}\n");
+end
+
+fn = fopen("betapaths.tex", "w");
+
+for i = (1:n)
+ fprintf(fn, "\\def\\alpha%s{%f}\n", strtrim(names(i,:)), alpha(i));
+ fprintf(fn, "\\def\\beta%s{%f}\n", strtrim(names(i,:)), beta(i));
+end
+
+for i = (1:n)
+ for j = (1:n)
+ printf("working on %d,%d:\n", i, j);
+ plotbeta(fn, alpha(i), beta(j),
+ char(['a' + i - 1, 'a' + j - 1]));
+ end
+end
+
+fclose(fn);
diff --git a/buch/chapters/040-rekursion/images/order.m b/buch/chapters/040-rekursion/images/order.m
new file mode 100644
index 0000000..762f458
--- /dev/null
+++ b/buch/chapters/040-rekursion/images/order.m
@@ -0,0 +1,119 @@
+#
+# order.m
+#
+# (c) 2022 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
+#
+global N;
+N = 10;
+global subdivisions;
+subdivisions = 100;
+global P;
+P = 0.5
+
+function retval = orderF(p, n, k)
+ retval = 0;
+ for i = (k:n)
+ retval = retval + nchoosek(n,i) * p^i * (1-p)^(n-i);
+ end
+end
+
+function retval = orderd(p, n, k)
+ retval = 0;
+ for i = (k:n)
+ s = i * p^(i-1) * (1-p)^(n-i);
+ s = s - p^i * (n-i) * (1-p)^(n-i-1);
+ retval = retval + nchoosek(n,i) * s;
+ end
+end
+
+function retval = orders(p, n, k)
+ retval = k * nchoosek(n, k) * p^(k-1) * (1-p)^(n-k);
+end
+
+function orderpath(fn, k, name)
+ fprintf(fn, "\\def\\order%s{\n\t(0,0)", name);
+ global N;
+ global subdivisions;
+ for i = (0:subdivisions)
+ p = i/subdivisions;
+ fprintf(fn, "\n\t-- ({%.4f*\\dx},{%.4f*\\dy})",
+ p, orderF(p, N, k));
+ end
+ fprintf(fn, "\n}\n");
+end
+
+function orderdpath(fn, k, name)
+ fprintf(fn, "\\def\\orderd%s{\n\t(0,0)", name);
+ global N;
+ global subdivisions;
+ for i = (1:subdivisions-1)
+ p = i/subdivisions;
+ fprintf(fn, "\n\t-- ({%.4f*\\dx},{%.4f*\\dy})",
+ p, orderd(p, N, k));
+ end
+ fprintf(fn, "\n\t-- ({1*\\dx},0)");
+ fprintf(fn, "\n}\n");
+end
+
+function orderspath(fn, k, name)
+ fprintf(fn, "\\def\\orders%s{\n\t(0,0)", name);
+ global N;
+ global subdivisions;
+ for i = (1:subdivisions-1)
+ p = i/subdivisions;
+ fprintf(fn, "\n\t-- ({%.4f*\\dx},{%.4f*\\dy})",
+ p, orders(p, N, k));
+ end
+ fprintf(fn, "\n\t-- ({1*\\dx},0)");
+ fprintf(fn, "\n}\n");
+end
+
+fn = fopen("orderpath.tex", "w");
+
+orderpath(fn, 0, "zero");
+orderdpath(fn, 0, "zero");
+orderspath(fn, 0, "zero");
+
+orderpath(fn, 1, "one");
+orderdpath(fn, 1, "one");
+orderspath(fn, 1, "one");
+
+orderpath(fn, 2, "two");
+orderdpath(fn, 2, "two");
+orderspath(fn, 2, "two");
+
+orderpath(fn, 3, "three");
+orderdpath(fn, 3, "three");
+orderspath(fn, 3, "three");
+
+orderpath(fn, 4, "four");
+orderdpath(fn, 4, "four");
+orderspath(fn, 4, "four");
+
+orderpath(fn, 5, "five");
+orderdpath(fn, 5, "five");
+orderspath(fn, 5, "five");
+
+orderpath(fn, 6, "six");
+orderdpath(fn, 6, "six");
+orderspath(fn, 6, "six");
+
+orderpath(fn, 7, "seven");
+orderdpath(fn, 7, "seven");
+orderspath(fn, 7, "seven");
+
+orderpath(fn, 8, "eight");
+orderdpath(fn, 8, "eight");
+orderspath(fn, 8, "eight");
+
+orderpath(fn, 9, "nine");
+orderdpath(fn, 9, "nine");
+orderspath(fn, 9, "nine");
+
+orderpath(fn, 10, "ten");
+orderdpath(fn, 10, "ten");
+orderspath(fn, 10, "ten");
+
+fclose(fn);
+
+
diff --git a/buch/chapters/040-rekursion/images/order.pdf b/buch/chapters/040-rekursion/images/order.pdf
new file mode 100644
index 0000000..cc175a9
--- /dev/null
+++ b/buch/chapters/040-rekursion/images/order.pdf
Binary files differ
diff --git a/buch/chapters/040-rekursion/images/order.tex b/buch/chapters/040-rekursion/images/order.tex
new file mode 100644
index 0000000..9a2511c
--- /dev/null
+++ b/buch/chapters/040-rekursion/images/order.tex
@@ -0,0 +1,125 @@
+%
+% order.tex -- Verteilungsfunktion für Ordnungsstatistik
+%
+% (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
+%
+\documentclass[tikz]{standalone}
+\usepackage{amsmath}
+\usepackage{times}
+\usepackage{txfonts}
+\usepackage{pgfplots}
+\usepackage{csvsimple}
+\usetikzlibrary{arrows,intersections,math}
+\begin{document}
+\def\skala{8}
+\definecolor{darkgreen}{rgb}{0,0.6,0}
+
+\def\n{10}
+\def\E#1#2{
+ \draw[color=#2]
+ ({\dx*#1/(\n+1)},{-0.1/\skala}) -- ({\dx*#1/(\n+1)},{4.4*\dy});
+ \node[color=#2] at ({\dx*#1/(\n+1)},{3.2*\dy})
+ [rotate=90,above right] {$k=#1$};
+}
+\def\var#1#2{
+ \pgfmathparse{\dx*sqrt(#1*(\n-#1+1)/((\n+1)*(\n+1)*(\n+2)))}
+ \xdef\var{\pgfmathresult}
+ \fill[color=#2,opacity=0.5]
+ ({\dx*#1/(\n+1)-\var},0) rectangle ({\dx*#1/(\n+1)+\var},{4.4*\dy});
+}
+
+\input{orderpath.tex}
+\begin{tikzpicture}[>=latex,thick,scale=\skala]
+
+\def\dx{1.6}
+\def\dy{0.5}
+
+\def\pfad#1#2{
+\draw[color=#2,line width=1.4pt] ({-0.1/\skala},0)
+ --
+ #1
+ --
+ ({1*\dx+0.1/\skala},0.5);
+}
+
+\pfad{\orderzero}{darkgreen!20}
+\pfad{\orderone}{darkgreen!20}
+\pfad{\ordertwo}{darkgreen!20}
+\pfad{\orderthree}{darkgreen!20}
+\pfad{\orderfour}{darkgreen!20}
+\pfad{\orderfive}{darkgreen!20}
+\pfad{\ordersix}{darkgreen!20}
+\pfad{\ordereight}{darkgreen!20}
+\pfad{\ordernine}{darkgreen!20}
+\pfad{\orderten}{darkgreen!20}
+\pfad{\orderseven}{darkgreen}
+
+\draw[->] ({-0.1/\skala},0) -- ({1.03*\dx},0) coordinate[label={$x$}];
+\draw[->] (0,{-0.1/\skala}) -- (0,0.6) coordinate[label={right:$F(X)$}];
+\foreach \x in {0,0.2,0.4,0.6,0.8,1}{
+ \draw ({\x*\dx},{-0.1/\skala}) -- ({\x*\dx},{0.1/\skala});
+ \node at ({\x*\dx},{-0.1/\skala}) [below] {$\x$};
+}
+\foreach \y in {0.5,1}{
+ \draw ({-0.1/\skala},{\y*\dy}) -- ({0.1/\skala},{\y*\dy});
+ \node at ({-0.1/\skala},{\y*\dy}) [left] {$\y$};
+}
+
+\node[color=darkgreen] at (0.65,{0.5*\dy}) [above,rotate=55] {$k=7$};
+
+\begin{scope}[yshift=-0.7cm]
+\def\dy{0.125}
+
+\foreach \k in {1,2,3,4,5,6,8,9,10}{
+ \E{\k}{blue!30}
+}
+\def\k{7}
+\var{\k}{orange!40}
+\node[color=blue] at ({\dx*\k/(\n+1)},{4.3*\dy}) [above] {$E(X_{7:n})$};
+
+\def\pfad#1#2{
+ \draw[color=#2,line width=1.4pt] ({-0.1/\skala},0)
+ --
+ #1
+ --
+ ({1*\dx+0.1/\skala},0.0);
+}
+
+\begin{scope}
+\clip ({-0.1/\skala},{-0.1/\skala})
+ rectangle ({1*\dx+0.1/\skala},{0.56+0.1/\skala});
+
+\pfad{\orderdzero}{red!20}
+\pfad{\orderdone}{red!20}
+\pfad{\orderdtwo}{red!20}
+\pfad{\orderdthree}{red!20}
+\pfad{\orderdfour}{red!20}
+\pfad{\orderdfive}{red!20}
+\pfad{\orderdsix}{red!20}
+\pfad{\orderdeight}{red!20}
+\pfad{\orderdnine}{red!20}
+\pfad{\orderdten}{red!20}
+\E{\k}{blue}
+\pfad{\orderdseven}{red}
+
+\end{scope}
+
+\draw[->] ({-0.1/\skala},0) -- ({1.03*\dx},0) coordinate[label={$x$}];
+\draw[->] (0,{-0.1/\skala}) -- (0,0.6) coordinate[label={right:$\varphi(X)$}];
+\foreach \x in {0,0.2,0.4,0.6,0.8,1}{
+ \draw ({\x*\dx},{-0.1/\skala}) -- ({\x*\dx},{0.1/\skala});
+ \node at ({\x*\dx},{-0.1/\skala}) [below] {$\x$};
+}
+\foreach \y in {1,2,3,4}{
+ \draw ({-0.1/\skala},{\y*\dy}) -- ({0.1/\skala},{\y*\dy});
+ \node at ({-0.1/\skala},{\y*\dy}) [left] {$\y$};
+}
+
+\node[color=red] at ({0.67*\dx},{2.7*\dy}) [above] {$k=7$};
+
+
+\end{scope}
+
+\end{tikzpicture}
+\end{document}
+