\documentclass[12pt]{article}
\usepackage{amsmath, amssymb, graphicx, array, fancyhdr, unicode-math, multirow}

\DeclareMathOperator{\Var}{Var}
\DeclareMathOperator{\sd}{SD}
\DeclareMathOperator{\Pois}{Pois}
\DeclareMathOperator{\Bin}{Bin}
\DeclareMathOperator{\NegBin}{NegBin}
\DeclareMathOperator{\sech}{sech}


% Text: Calibri, all bold
\setmainfont{Calibri}
\renewcommand{\seriesdefault}{b}

% Math: choose a math font and visually embolden it
\setmathfont{TeX Gyre Termes Math}                  % base math font
\setmathfont[FakeBold=1.9]{TeX Gyre Termes Math}    % embolden; adjust 1.6–2.4

% header
\pagestyle{fancy}
\fancyhf{}
\lhead{\resizebox{!}{2cm}{A}}
\chead{\raisebox{0.5cm}{\Huge Expected Value - Function}} % (add title text if you want)
\rhead{\resizebox{!}{2cm}{A}}
\setlength{\headheight}{2.5cm}
\setlength{\headsep}{12pt} % space between header and body

\begin{document}
\thispagestyle{fancy}

% -------- PAGE 1 --------
\begin{table}[h!]
  \renewcommand{\arraystretch}{1.2}

% -------- Single -------------------
\begin{tabular}{m{1.2in} m{4in}}
\multirow{5}{*}{\fbox{\includegraphics[width=1in]{images/single.png}}} 
&$Y = 20 - 2X$\\
&$E(X) = 6$\\
&$E(Y) = ?$\\
&\\
&\\
\end{tabular}

% -------- Abstract -------------------
\begin{tabular}{m{1.2in} m{4in}}
\multirow{5}{*}{\fbox{\includegraphics[width=1in]{images/abstract.png}}} 
&$E(Y) = E(20 - 2X)$\\
&$E(20 - 2X) = E(20) - 2E(X)$\\
&$E(20) = 20$\\
&$E(Y) = 20 - 2(6) = 20 - 12 = 8$\\
&\\
\end{tabular}

% -------- Question -------------------
\begin{tabular}{m{1.2in} m{4in}}
\multirow{5}{*}{\fbox{\includegraphics[width=1in]{images/question.png}}} 
&$x = \{1, 2, 3, 4\}$\\
&$p(x) = c x^2$\\
&$c=?$\\
&$E(X) = ?$\\
&$E(X(X-1))=?$\\
\end{tabular}
\end{table}


% second page
\newpage
\thispagestyle{fancy}
\begin{table}[h!]
% -------- Answer -------------------
\begin{tabular}{m{1.2in} m{4in}}
\multirow{5}{*}{\fbox{\includegraphics[width=1in]{images/key.png}}} 
&$x = \{1, 2, 3, 4\}$\\
&$p(x) = c x^2$\\
&$c=?$\\
&$E(X) = ?$\\
&$E(X(X-1))=?$\\
&\hrule\\
&\\
&$\sum_{x=1}^4 c x^2 = 1 \Rightarrow c \sum_{x=1}^4 x^2 = 1$\\
&\\
&$\sum_{x=1}^4 x^2 = 1^2 + 2^2 + 3^2 + 4^2 = 1 + 4 + 9 + 16 = 30$\\
&\\
&$c = \frac{1}{30}$\\
&\hrule\\
&\\
&$E(X) = \sum x \cdot p(x) = \sum_{x=1}^4 x \cdot c x^2 = c \sum_{x=1}^4 x^3$\\
&\\
&$\sum_{x=1}^4 x^3 = 1^3 + 2^3 + 3^3 + 4^3 = 1 + 8 + 27 + 64 = 100$\\
&\\
&$E(X) = \frac{1}{30} \cdot 100 = \frac{10}{3}$\\
&\hrule\\
&\\
&$E(X(X - 1)) = \sum x(x - 1) \times p(x) = \sum_{x=1}^4 x(x - 1) \times c x^2 = c \sum_{x=1}^4 x(x - 1)x^2$\\
&\\
&$x(x - 1)x^2 = x^3(x - 1)$\\
&\\
&$\sum_{x=1}^4 x^3(x - 1) = \sum_{x=1}^4 (x^4 - x^3)$\\
&\\
&$x = 1$: $1^4 - 1^3 = 0$\\
&$x = 2$: $16 - 8 = 8$\\
&$x = 3$: $81 - 27 = 54$\\
&$x = 4$: $256 - 64 = 192$\\
&\hrule\\
&\\
&$\sum_{x=1}^4 x^3(x - 1) = 0 + 8 + 54 + 192 = 254$\\
&\\
&$E(X(X - 1)) = \frac{1}{30} \cdot 254 = \frac{127}{15} \approx 8.47$\\
\end{tabular}
\end{table}
\end{document}