# Horizontal alignment: Function and a table

I have the following table:

\begin{table}[h!]
\def\arraystretch{1.5}
\begin{tabular}{c|cccc}
$x$ & $-4$ & $0$ & $4$ & $12$ \\ \hline
$P_X(x)$ & $\frac{1}{4}$ & $\frac{1}{6}$ & $\frac{1}{4}$ & $\frac{1}{3}$ \\ \hline
$F_X(x)$ & $\frac{1}{4}$ & $\frac{5}{12}$ & $\frac{2}{3}$ & $1$
\end{tabular}
\end{table}


and the following function:

$$F_X(x)=\begin{cases}0&\text{für \phantom{a}}x < -4,\\ 1/4&\text{für \phantom{a}}-4 \leq x < 0,\\ 5/12&\text{für \phantom{a}}0 \leq x < 4, \\ 2/3&\text{für \phantom{a}}4 \leq x < 12, \\ 1&\text{für \phantom{a}} x \geq 12. \\ \end{cases}$$


They look like this:

What I want is: [Table] $\Rightarrow$ [Function], so that they are next to each other (horizontally). How can I do this? Any help would be much appreciated!

• Just [Table] $\Rightarrow [Function]$ works, but [Table] is not the table float environment, but only the tabular environment.
– Fran
Commented May 11, 2020 at 21:45
• @Fran Where do I put this? Can you please show it my code? Commented May 11, 2020 at 21:49

\documentclass{article}
$\begin{array}{c|cccc} x & -4 & 0 & 4 & 12 \\ \hline P_X(x) & \frac{1}{4} & \frac{1}{6} & \frac{1}{4} & \frac{1}{3} \\ \hline F_X(x) & \frac{1}{4} & \frac{5}{12} & \frac{2}{3} & 1 \end{array} \Rightarrow F_X(x)=\begin{cases}0&\text{für \phantom{a}}x < -4,\\ 1/4&\text{für \phantom{a}}-4 \leq x < 0,\\ 5/12&\text{für \phantom{a}}0 \leq x < 4, \\ 2/3&\text{für \phantom{a}}4 \leq x < 12, \\ 1&\text{für \phantom{a}} x \geq 12. \\ \end{cases}$