[spec] clean up
authorAndrew Lorimer <andrew@lorimer.id.au>
Mon, 9 Sep 2019 11:59:08 +0000 (21:59 +1000)
committerAndrew Lorimer <andrew@lorimer.id.au>
Mon, 9 Sep 2019 11:59:08 +0000 (21:59 +1000)
spec/normal-dist-graph.tex [new file with mode: 0644]
spec/spec-collated.pdf
spec/spec-collated.tex
spec/statistics.pdf
spec/statistics.tex
diff --git a/spec/normal-dist-graph.tex b/spec/normal-dist-graph.tex
new file mode 100644 (file)
index 0000000..b0b558a
--- /dev/null
@@ -0,0 +1,81 @@
+\pgfmathdeclarefunction{gauss}{2}{%
+  \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}%
+}
+
+\pgfkeys{/pgf/decoration/.cd,
+  distance/.initial=10pt
+}
+
+\pgfdeclaredecoration{add dim}{final}{
+  \state{final}{% 
+    \pgfmathsetmacro{\dist}{5pt*\pgfkeysvalueof{/pgf/decoration/distance}/abs(\pgfkeysvalueof{/pgf/decoration/distance})}    
+    \pgfpathmoveto{\pgfpoint{0pt}{0pt}}             
+    \pgfpathlineto{\pgfpoint{0pt}{2*\dist}}   
+    \pgfpathmoveto{\pgfpoint{\pgfdecoratedpathlength}{0pt}} 
+    \pgfpathlineto{\pgfpoint{(\pgfdecoratedpathlength}{2*\dist}}     
+    \pgfsetarrowsstart{latex}
+    \pgfsetarrowsend{latex}
+    \pgfpathmoveto{\pgfpoint{0pt}{\dist}}
+    \pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{\dist}} 
+    \pgfusepath{stroke} 
+    \pgfpathmoveto{\pgfpoint{0pt}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{0pt}}
+}}
+
+\tikzset{dim/.style args={#1,#2}{decoration={add dim,distance=#2},
+  decorate,
+  postaction={decorate,decoration={text along path,
+  raise=#2,
+  text align={align=center},
+  text={#1}}}}
+}
+
+\begin{tikzpicture}
+  \begin{axis}[every axis plot post/.style={
+      mark=none,domain=-3:3,samples=50,smooth}, 
+    axis x line=bottom, 
+    axis y line=left,
+    enlargelimits=upper,
+    x=\textwidth/10,
+    ytick={0.55},
+    yticklabels={\(\frac{1}{\sigma \sqrt{2\pi}}\)}, 
+    xtick={-2,-1,0,1,2},
+    x tick label style = {font=\footnotesize},
+    xticklabels={\((\mu-2\sigma)\), \((\mu-\sigma)\), \(\mu\), \((\mu+\sigma)\), \((\mu+2\sigma)\)},
+    xlabel={\(x\)},
+    every axis x label/.style={at={(current axis.right of origin)},anchor=north west},
+    every axis y label/.style={at={(axis description cs:-0.02,0.2)}, anchor=south west, rotate=90},
+    ylabel={\(\Pr(X=x)\)}]
+    \addplot {gauss(0,0.75)};
+    \fill[red!30] (-3,0)  -- plot[id=f3,domain=-3:3,samples=50] function {1/(0.75*sqrt(2*pi))*exp(-((x)^2)/(2*0.75^2))} -- (3,0) -- cycle;
+    \fill[darkgray!30] (3,0)  -- plot[id=f3,domain=-3:3,samples=50] function {1/(0.75*sqrt(2*pi))*exp(-x*x*0.5/(0.75*0.75))} -- (3,0) -- cycle;
+    \fill[lightgray!30] (-2,0)  -- plot[id=f3,domain=-2:2,samples=50] function {1/(0.75*sqrt(2*pi))*exp(-x*x*0.5/(0.75*0.75))} -- (2,0) -- cycle;
+    \fill[white!30] (-1,0)  -- plot[id=f3,domain=-1:1,samples=50] function {1/(0.75*sqrt(2*pi))*exp(-x*x*0.5/(0.75*0.75))} -- (1,0) -- cycle;
+    \begin{scope}[<->]
+      \draw (-1,0.35) -- (1,0.35) node [midway, fill=white] {68.3\%};
+      \draw (-2,0.25) -- (2,0.25) node [midway, fill=white] {95.5\%};
+      \draw (-3,0.15) -- (3,0.15) node [midway, fill=white] {99.7\%};
+    \end{scope}
+    \begin{scope}[-, dashed, gray]
+      \draw (-1,0) -- (-1, 0.35);
+      \draw (1,0) -- (1, 0.35);
+      \draw (-2,0) -- (-2, 0.25);
+      \draw (2,0) -- (2, 0.25);
+      \draw (-3,0) -- (-3, 0.15);
+      \draw (3,0) -- (3, 0.15);
+    \end{scope}
+  \end{axis}
+  \begin{axis}[every axis plot post/.append style={
+      mark=none,domain=-3:3,samples=50,smooth}, 
+    axis x line=bottom, 
+    enlargelimits=upper,
+    x=\textwidth/10,
+    xtick={-2,-1,0,1,2},
+    axis x line shift=30pt,
+    hide y axis,
+    x tick label style = {font=\footnotesize},
+    xlabel={\(Z\)},
+    every axis x label/.style={at={(axis description cs:1,-0.25)},anchor=south west}]
+    \addplot {gauss(0,0.75)};
+  \end{axis}
+\end{tikzpicture}
index def810118956fe37581f55bf2ea46a7adc6fdc83..705bf5d3a644d3e2067a96414ca760834bd1e307 100644 (file)
Binary files a/spec/spec-collated.pdf and b/spec/spec-collated.pdf differ
index e747466de93d642db8a9f7785a72ac874570398d..4adcd53d464c205ead2d43104ef40974dc4c6f51 100644 (file)
@@ -1,36 +1,60 @@
 \documentclass[a4paper]{article}
-\usepackage[a4paper,margin=2cm]{geometry}
-\usepackage{multicol}
-\usepackage{dblfloatfix}
-\usepackage{multirow}
+\usepackage[dvipsnames, table]{xcolor}
 \usepackage{amsmath}
 \usepackage{amssymb}
-\usepackage{harpoon}
-\usepackage{tabularx}
-\usepackage{makecell}
-\usepackage{enumitem}
-\usepackage[obeyspaces]{url}
-\usepackage[dvipsnames, table]{xcolor}
 \usepackage{blindtext}
+\usepackage{dblfloatfix}
+\usepackage{enumitem}
+\usepackage{fancyhdr}
+\usepackage[a4paper,margin=2cm]{geometry}
 \usepackage{graphicx}
-\usepackage{wrapfig}
+\usepackage{harpoon}
+\usepackage{import}
+\usepackage{keystroke}
+\usepackage{listings}
+\usepackage{makecell}
+\usepackage{mathtools}
+\usepackage{mathtools}
+\usepackage{multicol}
+\usepackage{multirow}
+\usepackage{pgfplots}
+\usepackage{pst-plot}
+\usepackage{subfiles}
+\usepackage{tabularx}
+\usepackage{tcolorbox}
+\usepackage{tikz-3dplot}
 \usepackage{tikz}
 \usepackage{tkz-fct}
-\usepackage{tikz-3dplot}
-\usepackage{pgfplots}
-\usetikzlibrary{arrows,
-    decorations,
-    decorations.markings,
-    decorations.text,
-    decorations.pathreplacing,
-    scopes
+\usepackage[obeyspaces]{url}
+\usepackage{wrapfig}
+
+
+\usetikzlibrary{%
+  angles,
+  arrows,
+  arrows.meta,
+  calc,
+  datavisualization.formats.functions,
+  decorations,
+  decorations.markings,
+  decorations.text,
+  decorations.pathreplacing,
+  decorations.text,
+  scopes
 }
-\usetikzlibrary{datavisualization.formats.functions}
-\usetikzlibrary{decorations.markings}
-\usepgflibrary{arrows.meta}
-\usetikzlibrary{decorations.markings}
+
+\newcommand{\midarrow}{\tikz \draw[-triangle 90] (0,0) -- +(.1,0);}
+
 \usepgflibrary{arrows.meta}
-\usepackage{pst-plot}
+\pgfplotsset{compat=1.16}
+\pgfplotsset{every axis/.append style={
+  axis x line=middle,    % put the x axis in the middle
+  axis y line=middle,    % put the y axis in the middle
+  axis line style={->}, % arrows on the axis
+  xlabel={$x$},          % default put x on x-axis
+  ylabel={$y$},          % default put y on y-axis
+}}
+
 \psset{dimen=monkey,fillstyle=solid,opacity=.5}
 \def\object{%
     \psframe[linestyle=none,fillcolor=blue](-2,-1)(2,1)
         \uput[-90]{*0}(0,-2){$\vec{w}$}}
 }
 
-\usetikzlibrary{calc}
-\usetikzlibrary{angles}
-\usetikzlibrary{datavisualization.formats.functions}
-\usetikzlibrary{decorations.markings}
-\usepgflibrary{arrows.meta}
-\usepackage{fancyhdr}
 \pagestyle{fancy}
 \fancyhead[LO,LE]{Year 12 Specialist}
 \fancyhead[CO,CE]{Andrew Lorimer}
-\usepackage{mathtools}
-\usepackage{xcolor} % used only to show the phantomed stuff
+
 \renewcommand\hphantom[1]{{\color[gray]{.6}#1}} % comment out!
-\setlength\fboxsep{0pt} \setlength\fboxrule{.2pt} % for the \fboxes
 \newcommand*\leftlap[3][\,]{#1\hphantom{#2}\mathllap{#3}}
 \newcommand*\rightlap[2]{\mathrlap{#2}\hphantom{#1}}
+\linespread{1.5}
+\setlength{\parindent}{0pt}
+\setlength\fboxsep{0pt} \setlength\fboxrule{.2pt} % for the \fboxes
+
 \newcolumntype{L}[1]{>{\hsize=#1\hsize\raggedright\arraybackslash}X}%
 \newcolumntype{R}[1]{>{\hsize=#1\hsize\raggedleft\arraybackslash}X}%
+
 \definecolor{cas}{HTML}{e6f0fe}
 \definecolor{important}{HTML}{fc9871}
 \definecolor{dark-gray}{gray}{0.2}
-\linespread{1.5}
-\newcommand{\midarrow}{\tikz \draw[-triangle 90] (0,0) -- +(.1,0);}
+
 \newcommand{\tg}{\mathop{\mathrm{tg}}}
 \newcommand{\cotg}{\mathop{\mathrm{cotg}}}
 \newcommand{\arctg}{\mathop{\mathrm{arctg}}}
 \newcommand{\arccotg}{\mathop{\mathrm{arccotg}}}
-\pgfplotsset{every axis/.append style={
-  axis x line=middle,    % put the x axis in the middle
-  axis y line=middle,    % put the y axis in the middle
-  axis line style={->}, % arrows on the axis
-  xlabel={$x$},          % default put x on x-axis
-  ylabel={$y$},          % default put y on y-axis
-}}
-\usepackage{tcolorbox}
+
 \newtcolorbox{warning}{colback=white!90!black, leftrule=3mm, colframe=important, coltext=important, fontupper=\sffamily\bfseries}
 \newtcolorbox{cas}{colframe=cas!75!black, title=On CAS, left*=3mm}
-\usepackage{keystroke}
-\usepackage{listings}
-\usepackage{mathtools}
-\pgfplotsset{compat=1.16}
-\usepackage{subfiles}
-\usepackage{import}
-\setlength{\parindent}{0pt}
+
 \begin{document}
 
 \begin{multicols}{2}
index 5ee10734e799982484a0982968768e6497d8b606..5408f9ead6b38066451bad55ab97ad94bf715d32 100644 (file)
Binary files a/spec/statistics.pdf and b/spec/statistics.pdf differ
index d7e772321995d2f0757d5872269c7a9ddde2a420..323ec2ac410e6e775239a53452756cc08d8f8a8d 100644 (file)
     Always express \(z\) as +ve. Express confidence \textit{interval} as ordered pair.
   \end{warning}
 
-\pgfmathdeclarefunction{gauss}{2}{%
-  \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}%
-}
-                  \pgfplotsset{every axis/.append style={
-                    axis x line=middle,    % put the x axis in the middle
-                    axis y line=middle,    % put the y axis in the middle
-                  }} \pgfkeys{/pgf/decoration/.cd,
-      distance/.initial=10pt
-}  \pgfdeclaredecoration{add dim}{final}{
-\state{final}{% 
-\pgfmathsetmacro{\dist}{5pt*\pgfkeysvalueof{/pgf/decoration/distance}/abs(\pgfkeysvalueof{/pgf/decoration/distance})}    
-          \pgfpathmoveto{\pgfpoint{0pt}{0pt}}             
-          \pgfpathlineto{\pgfpoint{0pt}{2*\dist}}   
-          \pgfpathmoveto{\pgfpoint{\pgfdecoratedpathlength}{0pt}} 
-          \pgfpathlineto{\pgfpoint{(\pgfdecoratedpathlength}{2*\dist}}     
-          \pgfsetarrowsstart{latex}
-          \pgfsetarrowsend{latex}
-          \pgfpathmoveto{\pgfpoint{0pt}{\dist}}
-          \pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{\dist}} 
-          \pgfusepath{stroke} 
-          \pgfpathmoveto{\pgfpoint{0pt}{0pt}}
-          \pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{0pt}}
-}}
-\tikzset{dim/.style args={#1,#2}{decoration={add dim,distance=#2},
-                decorate,
-                postaction={decorate,decoration={text along path,
-                                                 raise=#2,
-                                                 text align={align=center},
-                                                 text={#1}}}}}
-                  \begin{figure*}[hb]
-                    \centering
-                    {\begin{center} \begin{tikzpicture}
-  \pgfplotsset{set layers, axis x line=middle, axis y line=middle}
-\begin{axis}[every axis plot post/.append style={
-  mark=none,domain=-3:3,samples=50,smooth}, 
-  axis x line=bottom, 
-  axis y line=left,
-  enlargelimits=upper,
-  x=\textwidth/10,
-  ytick={0.55},
-  yticklabels={\(\frac{1}{\sigma \sqrt{2\pi}}\)}, 
-  xtick={-2,-1,0,1,2},
-  x tick label style = {font=\footnotesize},
-  xticklabels={\((\mu-2\sigma)\), \((\mu-\sigma)\), \(\mu\), \((\mu+\sigma)\), \((\mu+2\sigma)\)},
-  xlabel={\(x\)},
-  every axis x label/.style={at={(current axis.right of origin)},anchor=north west},
-  every axis y label/.style={at={(axis description cs:-0.02,0.2)}, anchor=south west, rotate=90},
-  ylabel={\(\Pr(X=x)\)}]
-  \addplot {gauss(0,0.75)};
-\fill[red!30] (-3,0)  -- plot[id=f3,domain=-3:3,samples=50]
-        function {1/(0.75*sqrt(2*pi))*exp(-((x)^2)/(2*0.75^2))} -- (3,0) -- cycle;
-  \fill[darkgray!30] (3,0)  -- plot[id=f3,domain=-3:3,samples=50] function {1/(0.75*sqrt(2*pi))*exp(-x*x*0.5/(0.75*0.75))} -- (3,0) -- cycle;
-  \fill[lightgray!30] (-2,0)  -- plot[id=f3,domain=-2:2,samples=50] function {1/(0.75*sqrt(2*pi))*exp(-x*x*0.5/(0.75*0.75))} -- (2,0) -- cycle;
-  \fill[white!30] (-1,0)  -- plot[id=f3,domain=-1:1,samples=50] function {1/(0.75*sqrt(2*pi))*exp(-x*x*0.5/(0.75*0.75))} -- (1,0) -- cycle;
-  \begin{scope}[<->]
-    \draw (-1,0.35) -- (1,0.35) node [midway, fill=white] {68.3\%};
-    \draw (-2,0.25) -- (2,0.25) node [midway, fill=white] {95.5\%};
-    \draw (-3,0.15) -- (3,0.15) node [midway, fill=white] {99.7\%};
-  \end{scope}
-  \begin{scope}[-, dashed, gray]
-    \draw (-1,0) -- (-1, 0.35);
-    \draw (1,0) -- (1, 0.35);
-    \draw (-2,0) -- (-2, 0.25);
-    \draw (2,0) -- (2, 0.25);
-    \draw (-3,0) -- (-3, 0.15);
-    \draw (3,0) -- (3, 0.15);
-  \end{scope}
-\end{axis}
-\begin{axis}[every axis plot post/.append style={
-  mark=none,domain=-3:3,samples=50,smooth}, 
-  axis x line=bottom, 
-  enlargelimits=upper,
-  x=\textwidth/10,
-  xtick={-2,-1,0,1,2},
-  axis x line shift=30pt,
-  hide y axis,
-  x tick label style = {font=\footnotesize},
-  xlabel={\(Z\)},
-  every axis x label/.style={at={(axis description cs:1,-0.25)},anchor=south west}]
-  \addplot {gauss(0,0.75)};
-\end{axis}
-\end{tikzpicture}\end{center}}
-                  \end{figure*}
+  \begin{figure*}[hb]
+    \centering
+    \include{normal-dist-graph}
+  \end{figure*}
 
   \subsection*{Central limit theorem}