Welcome to our community

Be a part of something great, join today!

TiKZ (solved) standard normal sscurve P(Z le t) =0.9

karush

Well-known member
Jan 31, 2012
3,084
b 90\% of the insects die after t hours.
(i) Represent this information on a standard normal curve diagram, indicating clearly the area representing 90\%
(ii) Find the value of \textbf{t}. $P(Z\le t) =0.9\quad Z = 1.282\quad t=57+(4.4(1.282))=62.64$ hours

\begin{tikzpicture}[scale=0.6]
%preamble \usepackage{pgfplots}
\newcommand\gauss[2]{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))} % Gauss function, parameters mu and sigma
\begin{axis}[every axis plot post/.append style={
mark=none,samples=50,smooth}, % All plots: 50 samples, smooth, no marks
axis x line*=bottom, % no box around the plot, only x axis
axis y line=none, % the * suppresses the arrow tips
enlargelimits=upper, % extend the axes a bit to the right and top
domain=-2:3, % Default for all plots: from -4:4
xtick={-.455,.9},
xticklabels={$-.455$,$.9$},
width=10cm,
height=4cm]
\addplot [fill=gray!30, draw=none, domain=-0.45:0.655] {\gauss{-0.455}{0.9}} \closedcycle;
\addplot {\gauss{-0.455}{0.9}};
\end{axis}
\end{tikzpicture}

ok I could't get this tikz to match the information
 

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
9,593
b 90\% of the insects die after t hours.
(i) Represent this information on a standard normal curve diagram, indicating clearly the area representing 90\%
(ii) Find the value of \textbf{t}. $P(Z\le t) =0.9\quad Z = 1.282\quad t=57+(4.4(1.282))=62.64$ hours

ok I could't get this tikz to match the information
The standard normal curve has a mean of 0 and a standard deviation of 1. It is what $Z$ represents.
Consequently we use \gauss{0}{1} to specify the corresponding curve.

The domain is then from $z=-\infty$ up to $z=1.282$ so that we get the desired probability of $0.9$.
A value of $-\infty$ does not fit in the graph though, so instead we pick a range that gives a nice graph.
Let's say we start from $z=-3$ and go up to a maximum of $z=+3$.
Then the domain of the full graph is [domain=-3:3] and the domain of the part that we want to fill is [domain=-3:1.282]

If we fill that in, we get:
\begin{tikzpicture}[scale=0.6]
%preamble \usepackage{pgfplots}
\newcommand\gauss[2]{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))} % Gauss function, parameters mu and sigma
\begin{axis}[every axis plot post/.append style={
mark=none,samples=50,smooth}, % All plots: 50 samples, smooth, no marks
axis x line*=bottom, % no box around the plot, only x axis
axis y line=none, % the * suppresses the arrow tips
enlargelimits=upper, % extend the axes a bit to the right and top
domain=-2:3, % Default for all plots: from -4:4
xtick={1.282},
width=10cm,
height=4cm]
\addplot [fill=gray!30, draw=none, domain=-3:1.282] {\gauss{0}{1}} \closedcycle;
\addplot[domain=-3:3] {\gauss{0}{1}};
\end{axis}
\end{tikzpicture}

Btw, we don't need to specify xticklabels. Those labels are implicit. We only need it if we want to show something different than the corresponding xtick values.
 

karush

Well-known member
Jan 31, 2012
3,084
Mahalo
yeah im trying to learn tikz