From: Andrew Lorimer Date: Sun, 1 Sep 2019 12:03:21 +0000 (+1000) Subject: [spec] reorganise notes for sac X-Git-Tag: yr12~49 X-Git-Url: https://git.lorimer.id.au/notes.git/diff_plain/ac176d3d2464068ad19adb01a74f54d61c442562 [spec] reorganise notes for sac --- diff --git a/spec/dynamics.pdf b/spec/dynamics.pdf index ca06d37..dc59835 100644 Binary files a/spec/dynamics.pdf and b/spec/dynamics.pdf differ diff --git a/spec/dynamics.tex b/spec/dynamics.tex index 5891f4e..b6a1af8 100644 --- a/spec/dynamics.tex +++ b/spec/dynamics.tex @@ -1,105 +1,58 @@ -\documentclass[a4paper, tikz, pstricks]{article} -\usepackage[a4paper,margin=2cm]{geometry} -\usepackage{array} -\usepackage{amsmath} -\usepackage{amssymb} -\usepackage{tcolorbox} -\usepackage{fancyhdr} -\usepackage{pgfplots} -\usepackage{tikz} -\usetikzlibrary{arrows, - calc, - decorations, - scopes, - angles -} -\usetikzlibrary{calc} -\usetikzlibrary{angles} -\usetikzlibrary{datavisualization.formats.functions} -\usetikzlibrary{decorations.markings} -\usepgflibrary{arrows.meta} -\usetikzlibrary{decorations.markings} -\usepgflibrary{arrows.meta} -\usepackage{pst-plot} -\psset{dimen=monkey,fillstyle=solid,opacity=.5} -\def\object{% - \psframe[linestyle=none,fillcolor=blue](-2,-1)(2,1) - \psaxes[linecolor=gray,labels=none,ticks=none]{->}(0,0)(-3,-3)(3,2)[$x$,0][$y$,90] - \rput{*0}{% - \psline{->}(0,-2)% - \uput[-90]{*0}(0,-2){$\vec{w}$}} -} - -\usepackage{tabularx} -\usetikzlibrary{angles} -\usepackage{keystroke} -\usepackage{listings} -\usepackage{xcolor} % used only to show the phantomed stuff -\definecolor{cas}{HTML}{e6f0fe} - -\pagestyle{fancy} -\fancyhead[LO,LE]{Year 12 Specialist - Dynamics} -\fancyhead[CO,CE]{Andrew Lorimer} - -\setlength\parindent{0pt} - +\documentclass[spec-collated.tex]{subfiles} \begin{document} -\title{Dynamics} -\author{} -\date{} -\maketitle +\section{Dynamics} -\section{Resolution of forces} +\subsection*{Resolution of forces} \textbf{Resultant force} is sum of force vectors -\subsection*{In angle-magnitude form} +\subsubsection*{In angle-magnitude form} \makebox[3cm]{Cosine rule:} \(c^2=a^2+b^2-2ab\cos\theta\) \makebox[3cm]{Sine rule:} \(\dfrac{a}{\sin A}=\dfrac{b}{\sin B}=\dfrac{c}{\sin C}\) -\subsection*{In \(\boldsymbol{i}\)---\(\boldsymbol{j}\) form} +\subsubsection*{In \(\boldsymbol{i}\)---\(\boldsymbol{j}\) form} Vector of \(a\) N at \(\theta\) to \(x\) axis is equal to \(a \cos \theta \boldsymbol{i} + a \sin \theta \boldsymbol{j}\). Convert all force vectors then add. To find angle of an \(a\boldsymbol{i} + b\boldsymbol{j}\) vector, use \(\theta = \tan^{-1} \frac{b}{a}\) -\subsection*{Resolving in a given direction} +\subsubsection*{Resolving in a given direction} The resolved part of a force \(P\) at angle \(\theta\) is has magnitude \(P \cos \theta\) To convert force \(||\vec{OA}\) to angle-magnitude form, find component \(\perp\vec{OA}\) then \(|\boldsymbol{r}|=\sqrt{\left(||\vec{OA}\right)^2 + \left(\perp\vec{OA}\right)^2},\quad \theta = \tan^{-1}\dfrac{\perp\vec{OA}}{||\vec{OA}}\) -\section{Newton's laws} +\subsection*{Newton's laws} \begin{tcolorbox} - \begin{enumerate} - \item Velocity is constant without a net external velocity + \begin{enumerate}[leftmargin=1mm] + \item Velocity is constant without a net external force \item \(\frac{d}{dt} \rho \propto \Sigma F \implies \boldsymbol{F}=m\boldsymbol{a}\) \item Equal and opposite forces \end{enumerate} \end{tcolorbox} -\subsection*{Weight} +\subsubsection*{Weight} A mass of \(m\) kg has force of \(mg\) acting on it -\subsection*{Momentum \(\rho\)} +\subsubsection*{Momentum \(\rho\)} \[ \rho = mv \tag{units kg m/s or Ns} \] -\subsection*{Reaction force \(R\)} +\subsubsection*{Reaction force \(R\)} \begin{itemize} \item With no vertical velocity, \(R=mg\) - \item With upwards acceleration, \(R-mg=ma\) + \item With vertical acceleration, \(|R|=m|a|-mg\) \item With force \(F\) at angle \(\theta\), then \(R=mg-F\sin\theta\) \end{itemize} -\subsection*{Friction} +\subsubsection*{Friction} \[ F_R = \mu R \tag{friction coefficient} \] -\section{Inclined planes} +\subsection*{Inclined planes} \[ \boldsymbol{F} = |\boldsymbol{F}| \cos \theta \boldsymbol{i} + |\boldsymbol{F}| \sin \theta \boldsymbol{j} \] \begin{itemize} @@ -122,9 +75,7 @@ A mass of \(m\) kg has force of \(mg\) acting on it pulley/.style={thick} } -\begin{figure}[!htb] - \centering - \begin{tikzpicture} + \begin{center}\begin{tikzpicture} \pgfmathsetmacro{\Fnorme}{2} \pgfmathsetmacro{\Fangle}{30} @@ -153,17 +104,9 @@ A mass of \(m\) kg has force of \(mg\) acting on it \end{scope} \draw[force,->] (M.center) -- ++(0,-1) node[below] {$mg$}; \draw (M.center)+(-90:\arcr) arc [start angle=-90,end angle=\iangle-90,radius=\arcr] node [below, pos=.5] {\footnotesize\(\theta\)}; - \end{tikzpicture} -\end{figure} + \end{tikzpicture}\end{center} -\section{Connected particles} - -\begin{itemize} - \item \textbf{Suspended pulley:} tension in both sections of rope are equal - \item \textbf{Linear connection:} find acceleration of system first - \item \textbf{Pulley on right angle:} \(a = \frac{m_2g}{m_1+m_2}\) where \(m_2\) is suspended (frictionless on both surfaces) - \item \textbf{Pulley on edge of incline:} find downwards force \(W_2\) and components of mass on plane -\end{itemize} +\subsection*{Connected particles} \def\boxwidth{0.5} \tikzset{ @@ -172,8 +115,7 @@ A mass of \(m\) kg has force of \(mg\) acting on it } -\begin{figure}[!htb] - \centering +\begin{center} \begin{tikzpicture} \matrix[column sep=1cm] { @@ -231,22 +173,68 @@ A mass of \(m\) kg has force of \(mg\) acting on it \\ }; \end{tikzpicture} -\end{figure} + \end{center} + +\begin{itemize} + \item \textbf{Suspended pulley:} tension in both sections of rope are equal \\ + \(|a| = g \frac{m_1 - m_2}{m_1 + m_2}\) where \(m_1\) accelerates down \\ + With tension: \\ + \[ \begin{cases}m_1 g - T = m_1 a\\ T - m_2 g = m_2 a\end{cases} \\ \implies m_1 g - m_2 g = m_1 a + m_2 a \] + \item \textbf{String pulling mass on inclined pane:} Resolve parallel to plane \\ + \[ T-mg \sin \theta = ma \] + \item \textbf{Linear connection:} find acceleration of system first + \item \textbf{Pulley on right angle:} \(a = \frac{m_2g}{m_1+m_2}\) where \(m_2\) is suspended (frictionless on both surfaces) + \item \textbf{Pulley on edge of incline:} find downwards force \(W_2\) and components of mass on plane +\end{itemize} + +\hspace{2em}\parbox{8em}{In this example, note \(T_1 \ne T_2\):} + \begin{tikzpicture} + + \begin{scope} -\section{Equilibrium} + \coordinate (O) at (0,0); + \coordinate (A) at ($({3*cos(\iangle)},{3*sin(\iangle)})$); + \coordinate (B) at ($({3*cos(\iangle)},0)$); + \coordinate (C) at ($({(1-0.25*\boxwidth)*cos(\iangle)},{(1-0.25*\boxwidth)*sin(\iangle)})$); % centre of box + \coordinate (D) at ($(C)+(\iangle:\boxwidth)$); + \coordinate (E) at ($(D)+(90+\iangle:0.5*\boxwidth)$); + \coordinate (F) at ($(B)+(0,{1.5*sin(\iangle)})$); + \coordinate (G) at ($(A)+(\iangle:-2*\boxwidth)$); + \coordinate (H) at ($(G)+(90+\iangle:0.5*\boxwidth)$); + \coordinate (I) at ($(H)+(\iangle:-0.5*\boxwidth)$); + \coordinate (J) at ($(H)+(\iangle:\boxwidth)$); + \coordinate (X) at ($(A)+(\iangle:0.5*\boxwidth)$); % centre of pulley + \coordinate (Y) at ($(X)+(90+\iangle:0.5*\boxwidth)$); % chord of pulley + + \draw[plane] (O) -- (A) -- (B) -- (O); + \draw (O)+(\arcr,0) arc [start angle=0,end angle=\iangle,radius=\arcr] node [right, pos=.75] {\footnotesize\(\theta\)}; + + \draw [rotate=\iangle, m] (C) rectangle ++(\boxwidth,\boxwidth) node (z) [rotate=\iangle, midway, font=\footnotesize] {\(m_1\)}; + \draw [rotate=\iangle, m] (G) rectangle ++(\boxwidth,\boxwidth) node (l) [rotate=\iangle, midway, font=\footnotesize] {\(m_2\)}; + \draw [pulley] (A) -- (X) ++(0.5*\boxwidth, 0) arc[rotate=\iangle, start angle=0, delta angle=360, x radius=0.25, y radius=0.25] node(r) [midway, rotate=\iangle] {}; + \draw [string] (E) -- (H) node [midway, above, font=\footnotesize, rotate=\iangle] {\(T_2\)}; + \draw [string] (J) -- (Y) node [midway, above, font=\footnotesize, rotate=\iangle] {\(T_1\)} arc (90+\iangle:0:0.25) -- ++($(0,{-1.5*sin(\iangle)})$) node [midway, above right, font=\footnotesize] {\(T_1\)} node[m] {\(m_3\)}; + + \end{scope} + + \end{tikzpicture} +\subsection*{Equilibrium} \[ \dfrac{A}{\sin a} = \dfrac{B}{\sin b} = \dfrac{C}{\sin c} \tag{Lami's theorem}\] +\[ c^2 = a^2 + b^2 - 2ab \cos \theta \tag{cosine rule} \] Three methods: \begin{enumerate} \item Lami's theorem (sine rule) - \item Triangle of forces or CAS (use to verify) + \item Triangle of forces (cosine rule) \item Resolution of forces (\(\Sigma F = 0\) - simultaneous) \end{enumerate} -\colorbox{cas}{On CAS:} use Geometry, lock known constants. + \begin{cas} + \textbf{To verify:} Geometry tab, then select points with normal cursor. Click right arrow at end of toolbar and input point, then lock known constants. + \end{cas} -\section{Variable forces (DEs)} +\subsection*{Variable forces (DEs)} \[ a = \dfrac{d^2x}{dt^2} = \dfrac{dv}{dt} = v\dfrac{dv}{dx} = \dfrac{d}{dx} \left( \frac{1}{2} v^2 \right) \] diff --git a/spec/spec-collated.pdf b/spec/spec-collated.pdf index 2af5693..7aa2159 100644 Binary files a/spec/spec-collated.pdf and b/spec/spec-collated.pdf differ diff --git a/spec/spec-collated.tex b/spec/spec-collated.tex index 63d724d..0525085 100644 --- a/spec/spec-collated.tex +++ b/spec/spec-collated.tex @@ -1,12 +1,15 @@ \documentclass[a4paper]{article} \usepackage[a4paper,margin=2cm]{geometry} \usepackage{multicol} +\usepackage{dblfloatfix} \usepackage{multirow} \usepackage{amsmath} \usepackage{amssymb} \usepackage{harpoon} \usepackage{tabularx} \usepackage{makecell} +\usepackage{enumitem} +\usepackage[obeyspaces]{url} \usepackage[dvipsnames, table]{xcolor} \usepackage{blindtext} \usepackage{graphicx} @@ -15,6 +18,27 @@ \usepackage{tkz-fct} \usepackage{tikz-3dplot} \usepackage{pgfplots} +\usetikzlibrary{arrows, + decorations, + decorations.markings, + decorations.text, + scopes +} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{decorations.markings} +\usepgflibrary{arrows.meta} +\usetikzlibrary{decorations.markings} +\usepgflibrary{arrows.meta} +\usepackage{pst-plot} +\psset{dimen=monkey,fillstyle=solid,opacity=.5} +\def\object{% + \psframe[linestyle=none,fillcolor=blue](-2,-1)(2,1) + \psaxes[linecolor=gray,labels=none,ticks=none]{->}(0,0)(-3,-3)(3,2)[$x$,0][$y$,90] + \rput{*0}{% + \psline{->}(0,-2)% + \uput[-90]{*0}(0,-2){$\vec{w}$}} +} + \usetikzlibrary{calc} \usetikzlibrary{angles} \usetikzlibrary{datavisualization.formats.functions} @@ -24,7 +48,6 @@ \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! @@ -34,21 +57,31 @@ \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 - }} +\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} @@ -863,10 +896,6 @@ \(f^{\prime\prime} = 0\)) - \pgfplotsset{every axis/.append style={ - axis x line=none, % put the x axis in the middle - axis y line=none, % put the y axis in the middle - }} \begin{table*}[ht] \centering \begin{tabularx}{\textwidth}{rXXX} @@ -875,18 +904,18 @@ & \centering\(\dfrac{d^2 y}{dx^2} > 0\) & \centering \(\dfrac{d^2y}{dx^2}<0\) & \(\dfrac{d^2y}{dx^2}=0\) (inflection) \\ \hline \(\dfrac{dy}{dx}>0\) & - \makecell{\\\begin{tikzpicture}\begin{axis}[xmin=-3, xmax=0.8, scale=0.2, samples=50, unbounded coords=jump] \addplot[blue] {(e^(x))}; \addplot[red] {x/2.5+0.75}; \end{axis}\end{tikzpicture} \\Rising (concave up)}& - \makecell{\\\begin{tikzpicture}\begin{axis}[xmin=0.1, xmax=4, scale=0.2, samples=50, unbounded coords=jump] \addplot[blue] {(ln(x))}; \addplot[red] {x/1.5-0.56}; \end{axis}\end{tikzpicture} \\Rising (concave down)}& - \makecell{\\\begin{tikzpicture}\begin{axis}[xmin=-1.5, xmax=1.5, scale=0.2, samples=100] \addplot[blue] {(sin((deg x)))}; \addplot[red] {x}; \end{axis}\end{tikzpicture} \\Rising inflection point}\\ + \makecell{\\\begin{tikzpicture}\begin{axis}[axis x line=none, axis y line=none, xmin=-3, xmax=0.8, scale=0.2, samples=50, unbounded coords=jump] \addplot[blue] {(e^(x))}; \addplot[red] {x/2.5+0.75}; \end{axis}\end{tikzpicture} \\Rising (concave up)}& + \makecell{\\\begin{tikzpicture}\begin{axis}[axis x line=none, axis y line=none, xmin=0.1, xmax=4, scale=0.2, samples=50, unbounded coords=jump] \addplot[blue] {(ln(x))}; \addplot[red] {x/1.5-0.56}; \end{axis}\end{tikzpicture} \\Rising (concave down)}& + \makecell{\\\begin{tikzpicture}\begin{axis}[axis x line=none, axis y line=none, xmin=-1.5, xmax=1.5, scale=0.2, samples=100] \addplot[blue] {(sin((deg x)))}; \addplot[red] {x}; \end{axis}\end{tikzpicture} \\Rising inflection point}\\ \hline \(\dfrac{dy}{dx}<0\) & - \makecell{\\\begin{tikzpicture}\begin{axis}[xmin=-.5, xmax=1, ymin=-.5, ymax=.5, scale=0.2, samples=100] \addplot[blue] {(1/(x+1)-1}; \addplot[red] {-x}; \end{axis}\end{tikzpicture} \\Falling (concave up)}& - \makecell{\\\begin{tikzpicture}\begin{axis}[xmin=0, xmax=1.5, scale=0.2, samples=50, unbounded coords=jump] \addplot[blue] {(2-x*x)^(1/2)}; \addplot[red] {-x+2}; \end{axis}\end{tikzpicture} \\Falling (concave down)}& - \makecell{\\\begin{tikzpicture}\begin{axis}[xmin=1.5, xmax=4.5, scale=0.2, samples=100] \addplot[blue] {(sin((deg x)))}; \addplot[red] {-x+3.1415}; \end{axis}\end{tikzpicture} \\Falling inflection point}\\ + \makecell{\\\begin{tikzpicture}\begin{axis}[axis x line=none, axis y line=none, xmin=-.5, xmax=1, ymin=-.5, ymax=.5, scale=0.2, samples=100] \addplot[blue] {(1/(x+1)-1}; \addplot[red] {-x}; \end{axis}\end{tikzpicture} \\Falling (concave up)}& + \makecell{\\\begin{tikzpicture}\begin{axis}[axis x line=none, axis y line=none, xmin=0, xmax=1.5, scale=0.2, samples=50, unbounded coords=jump] \addplot[blue] {(2-x*x)^(1/2)}; \addplot[red] {-x+2}; \end{axis}\end{tikzpicture} \\Falling (concave down)}& + \makecell{\\\begin{tikzpicture}\begin{axis}[axis x line=none, axis y line=none, xmin=1.5, xmax=4.5, scale=0.2, samples=100] \addplot[blue] {(sin((deg x)))}; \addplot[red] {-x+3.1415}; \end{axis}\end{tikzpicture} \\Falling inflection point}\\ \hline \(\dfrac{dy}{dx}=0\)& - \makecell{\\\begin{tikzpicture}\begin{axis}[xmin=-1, xmax=1, scale=0.2, samples=50, unbounded coords=jump] \addplot[blue] {(x*x))}; \addplot[red, thick] {0}; \end{axis}\end{tikzpicture} \\Local minimum}& \makecell{\\\begin{tikzpicture}\begin{axis}[xmin=-1, xmax=1, scale=0.2, samples=50, unbounded coords=jump] \addplot[blue] {(-x*x))}; \addplot[red, very thick] {0}; \end{axis}\end{tikzpicture} \\Local maximum}& - \makecell{\\\begin{tikzpicture}\begin{axis}[xmin=-1, xmax=1, scale=0.2, samples=50, unbounded coords=jump] \addplot[blue] {(x*x*x))}; \addplot[red, thick] {0}; \end{axis}\end{tikzpicture} \(\>\) \begin{tikzpicture}\begin{axis}[xmin=-1, xmax=1, scale=0.2, samples=50, unbounded coords=jump] \addplot[blue] {(-x*x*x))}; \addplot[red, thick] {0}; \end{axis}\end{tikzpicture} \\Stationary inflection point}\\ + \makecell{\\\begin{tikzpicture}\begin{axis}[axis x line=none, axis y line=none, xmin=-1, xmax=1, scale=0.2, samples=50, unbounded coords=jump] \addplot[blue] {(x*x))}; \addplot[red, thick] {0}; \end{axis}\end{tikzpicture} \\Local minimum}& \makecell{\\\begin{tikzpicture}\begin{axis}[axis x line=none, axis y line=none, xmin=-1, xmax=1, scale=0.2, samples=50, unbounded coords=jump] \addplot[blue] {(-x*x))}; \addplot[red, very thick] {0}; \end{axis}\end{tikzpicture} \\Local maximum}& + \makecell{\\\begin{tikzpicture}\begin{axis}[axis x line=none, axis y line=none, xmin=-1, xmax=1, scale=0.2, samples=50, unbounded coords=jump] \addplot[blue] {(x*x*x))}; \addplot[red, thick] {0}; \end{axis}\end{tikzpicture} \(\>\) \begin{tikzpicture}\begin{axis}[axis x line=none, axis y line=none, xmin=-1, xmax=1, scale=0.2, samples=50, unbounded coords=jump] \addplot[blue] {(-x*x*x))}; \addplot[red, thick] {0}; \end{axis}\end{tikzpicture} \\Stationary inflection point}\\ \hline \end{tabularx} \end{table*} @@ -1217,5 +1246,7 @@ Let \(\boldsymbol{r}(t)=x(t)\boldsymbol{i} + y(t)\boldsymbol(j)\). If both \(x(t)\) and \(y(t)\) are differentiable, then: \[ \boldsymbol{r}(t)=x(t)\boldsymbol{i}+y(t)\boldsymbol{j} \] + \subfile{dynamics} + \subfile{statistics} \end{multicols} \end{document} diff --git a/spec/statistics.pdf b/spec/statistics.pdf index 60f093c..9a63860 100644 Binary files a/spec/statistics.pdf and b/spec/statistics.pdf differ diff --git a/spec/statistics.tex b/spec/statistics.tex index 4c89dd5..da1ec9b 100644 --- a/spec/statistics.tex +++ b/spec/statistics.tex @@ -1,33 +1,7 @@ -\documentclass[a4paper]{article} -\usepackage[a4paper, margin=2cm]{geometry} -\usepackage{array} -\usepackage{amsmath} -\usepackage{amssymb} -\usepackage{tcolorbox} -\usepackage{fancyhdr} -\usepackage{pgfplots} -\usepackage{tabularx} -\usepackage{keystroke} -\usepackage{listings} -\usepackage{xcolor} % used only to show the phantomed stuff -\definecolor{cas}{HTML}{e6f0fe} -\usepackage{mathtools} -\pgfplotsset{compat=1.16} - -\pagestyle{fancy} -\fancyhead[LO,LE]{Unit 4 Specialist --- Statistics} -\fancyhead[CO,CE]{Andrew Lorimer} - -\setlength\parindent{0pt} - +\documentclass[spec-collated.tex]{subfiles} \begin{document} - \title{Statistics} - \author{} - \date{} - \maketitle - - \section{Linear combinations of random variables} + \section{Statistics} \subsection*{Continuous random variables} @@ -38,9 +12,23 @@ \item \(\int^\infty_{-\infty} f(x) \> dx = 1\) \end{enumerate} + \begin{align*} + E(X) &= \int_\textbf{X} (x \cdot f(x)) \> dx \\ + \operatorname{Var}(X) &= E\left[(X-\mu)^2\right] + \end{align*} + \[ \Pr(X \le c) = \int^c_{-\infty} f(x) \> dx \] + - \subsubsection*{Linear functions \(X \rightarrow aX+b\)} + \subsection*{Two random variables \(X, Y\)} + + If \(X\) and \(Y\) are independent: + \begin{align*} + \operatorname{E}(aX+bY) & = a\operatorname{E}(X)+b\operatorname{E}(Y) \\ + \operatorname{Var}(aX \pm bY \pm c) &= a^2 \operatorname{Var}(X) + b^2 \operatorname{Var}(Y) + \end{align*} + + \subsection*{Linear functions \(X \rightarrow aX+b\)} \begin{align*} \Pr(Y \le y) &= \Pr(aX+b \le y) \\ @@ -53,31 +41,40 @@ \textbf{Variance:} && \operatorname{Var}(aX+b) &= a^2 \operatorname{Var}(X) \\ \end{align*} - \subsection*{Linear combination of two random variables} + \subsection*{Expectation theorems} + + For some non-linear function \(g\), the expected value \(E(g(X))\) is not equal to \(g(E(X))\). \begin{align*} - \textbf{Mean:} && \operatorname{E}(aX+bY) & = a\operatorname{E}(X)+b\operatorname{E}(Y) \\ - \textbf{Variance:} && \operatorname{Var}(aX+bY) &= a^2 \operatorname{Var}(X) + b^2 \operatorname{Var}(Y) \tag{if \(X\) and \(Y\) are independent}\\ + E(X^2) &= \operatorname{Var}(X) - \left[E(X)\right]^2 \\ + E(X^n) &= \Sigma x^n \cdot p(x) \tag{non-linear} \\ + &\ne [E(X)]^n \\ + E(aX \pm b) &= aE(X) \pm b \tag{linear} \\ + E(b) &= b \tag{\(\forall b \in \mathbb{R}\)}\\ + E(X+Y) &= E(X) + E(Y) \tag{two variables} \end{align*} - \section{Sample mean} + \subsection*{Sample mean} Approximation of the \textbf{population mean} determined experimentally. \[ \overline{x} = \dfrac{\Sigma x}{n} \] - where \(n\) is the size of the sample (number of sample points) and \(x\) is the value of a sample point - - \begin{tcolorbox}[colframe=cas!75!black, title=On CAS] + where + \begin{description}[nosep, labelindent=0.5cm] + \item \(n\) is the size of the sample (number of sample points) + \item \(x\) is the value of a sample point + \end{description} - \begin{enumerate} +\begin{cas} + \begin{enumerate}[leftmargin=3mm] \item Spreadsheet - \item In cell A1: \verb;mean(randNorm(sd, mean, sample size)); + \item In cell A1:\\ \path{mean(randNorm(sd, mean, sample size))} \item Edit \(\rightarrow\) Fill \(\rightarrow\) Fill Range \item Input range as A1:An where \(n\) is the number of samples \item Graph \(\rightarrow\) Histogram \end{enumerate} - \end{tcolorbox} + \end{cas} \subsubsection*{Sample size of \(n\)} @@ -87,27 +84,60 @@ For a new distribution with mean of \(n\) trials, \(\operatorname{E}(X^\prime) = \operatorname{E}(X), \quad \operatorname{sd}(X^\prime) = \dfrac{\operatorname{sd}(X)}{\sqrt{n}}\) - \begin{tcolorbox}[colframe=cas!75!black, title=On CAS] + \begin{cas} \begin{itemize} \item Spreadsheet \(\rightarrow\) Catalog \(\rightarrow\) \verb;randNorm(sd, mean, n); where \verb;n; is the number of samples. Show histogram with Histogram key in top left \item To calculate parameters of a dataset: Calc \(\rightarrow\) One-variable \end{itemize} - \end{tcolorbox} + + \end{cas} - \section{Normal distributions} + \subsection*{Normal distributions} - mean = mode = median \[ Z = \frac{X - \mu}{\sigma} \] - Normal distributions must have area (total prob.) of 1 \(\implies \int^\infty_{-\infty} f(x) \> dx = 1\) + Normal distributions must have area (total prob.) of 1 \(\implies \int^\infty_{-\infty} f(x) \> dx = 1\) \\ + \(\text{mean} = \text{mode} = \text{median}\) + + \begin{warning} + 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))} + \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}% } - -\begin{tikzpicture} - \pgfplotsset{set layers} + \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, @@ -124,6 +154,24 @@ 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}, @@ -138,55 +186,55 @@ 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{tikzpicture}\end{center}} + \end{figure*} - \section{Central limit theorem} + \subsection*{Central limit theorem} If \(X\) is randomly distributed with mean \(\mu\) and sd \(\sigma\), then with an adequate sample size \(n\) the distribution of the sample mean \(\overline{X}\) is approximately normal with mean \(E(\overline{X})\) and \(\operatorname{sd}(\overline{X}) = \frac{\sigma}{\sqrt{n}}\). - \section{Confidence intervals} + \subsection*{Confidence intervals} \begin{itemize} \item \textbf{Point estimate:} single-valued estimate of the population mean from the value of the sample mean \(\overline{x}\) \item \textbf{Interval estimate:} confidence interval for population mean \(\mu\) + \item \(C\)\% confidence interval \(\implies\) \(C\)\% of samples will contain population mean \(\mu\) \end{itemize} - \subsection{95\% confidence interval} - - The 95\% confidence interval for a population mean \(\mu\) is given by - - \[ \overline{x} \pm 1.96 \dfrac{\sigma}{\sqrt{n}} \] - - where: \\ - \(\overline{x}\) is the sample mean \\ - \(\sigma\) is the population sd \\ - \(n\) is the sample size from which \(\overline{x}\) was calculated + \subsubsection*{95\% confidence interval} - Always express \(z\) as +ve. Express confidence \textit{interval} as ordered pair. + For 95\% c.i. of population mean \(\mu\): - \colorbox{cas}{\textbf{On CAS}} + \[ x \in \left(\overline{x} \pm 1.96 \dfrac{\sigma}{\sqrt{n}} \right)\] - Menu \(\rightarrow\) Stats \(\rightarrow\) Calc \(\rightarrow\) Interval \\ - Set Type = One-Sample Z Int, Variable + where: + \begin{description}[nosep, labelindent=0.5cm] + \item \(\overline{x}\) is the sample mean + \item \(\sigma\) is the population sd + \item \(n\) is the sample size from which \(\overline{x}\) was calculated + \end{description} - \subsection*{Interpretation of confidence intervals} - - 95\% confidence interval \(\implies\) 95\% of samples will contain population mean \(\mu\). + \begin{cas} + Menu \(\rightarrow\) Stats \(\rightarrow\) Calc \(\rightarrow\) Interval \\ + Set \textit{Type = One-Sample Z Int} \\ \-\hspace{1em} and select \textit{Variable} + \end{cas} \subsection*{Margin of error} - For 95\% confidence interval for \(\mu\), margin of error \(M\) is: - + For 95\% confidence interval of \(\mu\): \begin{align*} M &= 1.96 \times \dfrac{\sigma}{\sqrt{n}} \\ \implies n &= \left( \dfrac{1.96 \sigma}{M} \right)^2 \end{align*} + Always round \(n\) up to a whole number of samples. + \subsection*{General case} - A confidence interval of \(C\)\% for a mean \(\mu\) s given by + For \(C\)\% c.i. of population mean \(\mu\): - \[ x \in \left( \overline{x} \pm k \dfrac{\sigma}{\sqrt{n}} \right) \quad \text{ where } k \text{ is such that } \Pr(-k < Z < k) = \frac{C}{100} \] + \[ x \in \left( \overline{x} \pm k \dfrac{\sigma}{\sqrt{n}} \right) \] + \hfill where \(k\) is such that \(\Pr(-k < Z < k) = \frac{C}{100}\) \subsection*{Confidence interval for multiple trials} @@ -194,7 +242,9 @@ \section{Hypothesis testing} - Note hypotheses are always expressed in terms of population parameters + \begin{warning} + Note hypotheses are always expressed in terms of population parameters + \end{warning} \subsection*{Null hypothesis \(H_0\)} @@ -218,23 +268,23 @@ Significance level is denoted by \(\alpha\). - If \(p<\alpha\), null hypothesis is \textbf{rejected} \\ - If \(p>\alpha\), null hypothesis is \textbf{accepted} + \-\hspace{1em} If \(p<\alpha\), null hypothesis is \textbf{rejected} \\ + \-\hspace{1em} If \(p>\alpha\), null hypothesis is \textbf{accepted} \subsection*{\(z\)-test} Hypothesis test for a mean of a sample drawn from a normally distributed population with a known standard deviation. - \subsubsection*{\colorbox{cas}{\textbf{On CAS:}}} - + \begin{cas} Menu \(\rightarrow\) Statistics \(\rightarrow\) Calc \(\rightarrow\) Test. \\ Select \textit{One-Sample Z-Test} and \textit{Variable}, then input: - \begin{itemize} - \item \(\mu\) condition - same operator as \(H_1\) - \item \(\mu_0\) - expected sample mean (null hypothesis) - \item \(\sigma\) - standard deviation (null hypothesis) - \item \(\overline{x}\) - sample mean - \item \(n\) - sample size - \end{itemize} + \begin{description}[nosep, style=multiline, labelindent=0.5cm, leftmargin=2cm, font=\normalfont] + \item[\(\mu\) cond:] same operator as \(H_1\) + \item[\(\mu_0\):] expected sample mean (null hypothesis) + \item[\(\sigma\):] standard deviation (null hypothesis) + \item[\(\overline{x}\):] sample mean + \item[\(n\):] sample size + \end{description} + \end{cas} \end{document}