I have a discrete probability distribution p(x) with the support ${\mathcal {X}} = {0,1,2,3,4,5,6,7,8,9}$ and I'd like to represent the distribution in the form of a table, similar to the one below
How do I do the job with latex?
I have a discrete probability distribution p(x) with the support ${\mathcal {X}} = {0,1,2,3,4,5,6,7,8,9}$ and I'd like to represent the distribution in the form of a table, similar to the one below
How do I do the job with latex?
If the two columns are supposed to be equally wide, use the first of the two approaches shown below; if not, use the second approach.
\documentclass{article}
\usepackage{array} % for 'w' column type
\begin{document}
\[
\begin{array}{w{c}{8mm}|w{c}{8mm}}
x & P(x) \\
\hline
2 & 1/16 \\
3 & 2/16 \\
4 & 3/16 \\
5 & 4/16 \\
6 & 3/16 \\
7 & 2/16 \\
8 & 1/16
\end{array}
\qquad
\begin{array}{c|c}
x & P(x) \\
\hline
2 & 1/16 \\
3 & 2/16 \\
4 & 3/16 \\
5 & 4/16 \\
6 & 3/16 \\
7 & 2/16 \\
8 & 1/16
\end{array}
\]
\end{document}
NiceMatrix. I keep it in mind... – projetmbc Jul 22 '21 at 08:24booktabs, they show the modern standard looks and how to produce it. – Gaussler Jul 22 '21 at 09:30