I have the following template for a journal article featuring a basic table:
The code looks something like this:
\documentclass[jou,apacite]{apa6}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\title{Title of the article}
\author{Author Name}
\affiliation{Affiliation}
\abstract{This is the abstract.}
\begin{document}
\maketitle
\section{This is the heading for the first section of the article.}
Lorem ipsum.
Results are presented in Table~\ref{tab1}.
\begin{table}[!htb]
\caption{Sample table.}\label{tab1}
\begin{tabular}{ccc}
\hline\\[-1.5ex]
AAA & BBB & CCC \\[0.5ex]
\hline\\[-1.5ex]
1.0 & 2.0 & 3.0\\[0.5ex]
1.0 & 2.0 & 3.0\\[0.5ex]
\hline
\end{tabular}
\end{table}
\section{This is the heading for the second section of the article.}
Lorem ipsum.
\end{document}
What I want to know is: Rather than typing in every value of a table manually, and potentially mistyping a digit or a decimal point here or there; is LaTeX capable of evaluating the math for me?
Consider the odds or probability of a coin toss winning streak, for example:
Each flip has 50:50 (1:1) odds: 50% probability of winning 50% probability of losing
The odds of winning two consecutive flips are 75:25 (3:1):
25% probability of winning 75% probability of losingThe odds of winning three consecutive flips are 87.5:12.5 (7:1):
12.5% probability of winning
87.5% probability of losingThe odds of winning four consecutive flips are 93.75/6.25 (15:1):
6.25% probability of winning
93.75% probability of losing
..and so on.
Probability of winning n consecutive flips is 2^(-n) * 100.
Probability of not winning n consecutive flips is 100 - (2^(-n)) * 100
Of course I could just calculate each value and type in every cell manually, but I might want to show ten or more flips. Anyway, is this something LaTeX can do?
pdfLaTeX
but have the others available too, if necessary.