# Thread: probability distributions

1. ## probability distributions

How do you write 1 and 2 dimensional distributions in TeX?
I use the TeXbook all the time and I can write matrices and determinants,
But I can't find how to type a discrete prob distribution via Tex.
That's with X and Y on the sides, and their values and the joint probabilities.

2. Originally Posted by matheagle
How do you write 1 and 2 dimensional distributions in TeX?
I use the TeXbook all the time and I can write matrices and determinants,
But I can't find how to type a discrete prob distribution via Tex.
That's with X and Y on the sides, and their values and the joint probabilities.
I'm trying to take a stab at this, but I'm not too sure what you're looking for.

Is it a table that is similar to those on this site?

3. Thanks
That's decent.
But all I think they did was print
----------------------
and |
there must be a command for it in TeX, u'd think
How do these textbook make these tables?
Probably not in TeX.

4. Originally Posted by matheagle
Thanks
That's decent.
But all I think they did was print
----------------------
and |
there must be a command for it in TeX, u'd think
How do these textbook make these tables?
Probably not in TeX.
I'm gonna recreate one of the tables on that site I gave you:

$
\begin{array}{| l || c | c | c |}
\hline
\hspace{1pc} & \text{Broken} & -\text{Broken} & \hspace{1pc} \\ \hline
\text{Smoke} & 0.02 & 0.01 & 0.03 = P\!\left(\text{Smoke}\right) \\ \hline
-\text{Smoke} & 0.06 & 0.91 & 0.097 = P\!\left(\text{Smoke}\right)\\ \hline
\hspace{1pc} & 0.08 = P\!\left(\text{Broken}\right) &
0.92= P\!\left(-\text{Broken}\right) & \hspace{1pc}\\ \hline
\end{array}
$

The code:

Code:
\begin{array}{| l || c | c | c |}
\hline
\hspace{1pc} & \text{Broken} & -\text{Broken} & \hspace{1pc} \\ \hline
\text{Smoke} & 0.02 & 0.01 & 0.03 = P\!\left(\text{Smoke}\right) \\ \hline
-\text{Smoke} & 0.06 & 0.91 & 0.097 = P\!\left(\text{Smoke}\right)\\ \hline
\hspace{1pc} & 0.08 = P\!\left(\text{Broken}\right) &
0.92= P\!\left(-\text{Broken}\right) & \hspace{1pc}\\ \hline
\end{array}
In TeX editors like TeXnic Center, the $\texttt{tabular}$ environment is better.

5. Originally Posted by Chris L T521
I'm gonna recreate one of the tables on that site I gave you:

$
\begin{array}{| l || c | c | c |}
\hline
\hspace{1pc} & \text{Broken} & -\text{Broken} & \hspace{1pc} \\ \hline
\text{Smoke} & 0.02 & 0.01 & 0.03 = P\!\left(\text{Smoke}\right) \\ \hline
-\text{Smoke} & 0.06 & 0.91 & 0.097 = P\!\left(\text{Smoke}\right)\\ \hline
\hspace{1pc} & 0.08 = P\!\left(\text{Broken}\right) &
0.92= P\!\left(-\text{Broken}\right) & \hspace{1pc}\\ \hline
\end{array}
$

The code:

Code:
\begin{array}{| l || c | c | c |}
\hline
\hspace{1pc} & \text{Broken} & -\text{Broken} & \hspace{1pc} \\ \hline
\text{Smoke} & 0.02 & 0.01 & 0.03 = P\!\left(\text{Smoke}\right) \\ \hline
-\text{Smoke} & 0.06 & 0.91 & 0.097 = P\!\left(\text{Smoke}\right)\\ \hline
\hspace{1pc} & 0.08 = P\!\left(\text{Broken}\right) &
0.92= P\!\left(-\text{Broken}\right) & \hspace{1pc}\\ \hline
\end{array}
In TeX editors like TeXnic Center, the $\texttt{tabular}$ environment is better.

Thanks
But I saw something like this in my Texbook and it didn't work, when I tried it. Nor did this work just now.
I'm using emtex I believe and maybe that's the problem.