Update 21st March 2020
\documentclass[12pt,a4paper,UTF8]{report}
%%
\usepackage{CJKutf8}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{enumerate}
\usepackage[left=1.5cm,right=1.5cm,top=2cm,bottom=2cm]{geometry}
%%
%% Header and Footer
\usepackage{fancyhdr}
\usepackage{lastpage}
%%
%% Figures and Graphs
\usepackage{adjustbox}
\usepackage{subfigure,float}
%\usepackage{graphicx,xcolor,subfigure,float}% for pictures
\graphicspath{{./Pictures/}}
%% Font
\usepackage[T1]{fontenc}
\usepackage[default,angular]{comicneue}
%% QR code for classroom
\usepackage{qrcode}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\theoremstyle{plain}
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\newtheorem{remark}{Remark}[section]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Example and Solution
%
\usepackage{tcolorbox}
\tcbuselibrary{skins,xparse,breakable}
\tcbset{%
colback=white,
tikz={opacity=1,transparency group},
colframe=black,
% breakable,
title filled=false,
% bookmark={Q\arabic{\tcbcounter}}
}
\NewTColorBox[
auto counter,
number within=section
]{example}{ +O{}mo }{%
fonttitle = \bfseries,
title = {Example~\thetcbcounter:~ #2},
before lower = {\textbf{Solution~\thetcbcounter:\quad}},
% lowerbox = invisible, %invisible/ignored
% after title/after upper
IfValueTF={#3}{after title={\hfill\colorbox{red}{\texttt #3 }}}{},
#1
}%
\usepackage{hyperref}
\begin{document}
\graphicspath{{./Pictures/bino_dist/}}
\begin{example}{Symmetry of binomial distribution}
A bag contains a large number of red and white discs, of which $85\%$ are red.
$20$ discs are taken from the bag.
Find the probability that the number of red discs lies between $12$ and $17$ inclusive.
\tcblower
%%%%%
%%%%% Let $X$ be the number of red discs. So $X \sim B(20,0.85)$. We want
\begin{equation}
P(12 \leq X \leq 17) = P(X \leq 17) - P(X \leq 11)
\end{equation}
Then we notice that the table only gives the probabilities for $p$ up to 0.5.
We have to go back to Figure~\ref{fig:bino-pdf} and think about using symmetry of the Binomial distribution.\\
%%%%%
Let $Y$ be the number of white discs and $Y \sim B(20,0.15)$. So we have
\begin{align}
P(12 \leq X \leq 17)
&=
P( 3 \leq Y \leq 8) \\
&=
P(Y \leq 8) - P(Y \leq 2) \\
&=
0.9987-0.4049 \\
&=
0.5938
\end{align}
The blue lines are ``probability'' of interest.
The graphs on the left are the full plot of the distribution, where the graphs on the right are zoomed in on the area of interest.
The top row represents the $X \sim B(20,0.85)$ distribution and the bottom row represents the $Y \sim B(20,0.15)$ distribution.
%%
%%
The blue lines are ``probability'' of interest.
The graphs on the left are the full plot of the distribution, where the graphs on the right are zoomed in on the area of interest.
The top row represents the $X \sim B(20,0.85)$ distribution and the bottom row represents the $Y \sim B(20,0.15)$ distribution.
%%
%%
The blue lines are ``probability'' of interest.
The graphs on the left are the full plot of the distribution, where the graphs on the right are zoomed in on the area of interest.
The top row represents the $X \sim B(20,0.85)$ distribution and the bottom row represents the $Y \sim B(20,0.15)$ distribution.
%%
%%
The blue lines are ``probability'' of interest.
The graphs on the left are the full plot of the distribution, where the graphs on the right are zoomed in on the area of interest.
The top row represents the $X \sim B(20,0.85)$ distribution and the bottom row represents the $Y \sim B(20,0.15)$ distribution.
%%
%%
The blue lines are ``probability'' of interest.
The graphs on the left are the full plot of the distribution, where the graphs on the right are zoomed in on the area of interest.
The top row represents the $X \sim B(20,0.85)$ distribution and the bottom row represents the $Y \sim B(20,0.15)$ distribution.
%%
%%
The blue lines are ``probability'' of interest.
The graphs on the left are the full plot of the distribution, where the graphs on the right are zoomed in on the area of interest.
The top row represents the $X \sim B(20,0.85)$ distribution and the bottom row represents the $Y \sim B(20,0.15)$ distribution.
%%
%%
The blue lines are ``probability'' of interest.
The graphs on the left are the full plot of the distribution, where the graphs on the right are zoomed in on the area of interest.
The top row represents the $X \sim B(20,0.85)$ distribution and the bottom row represents the $Y \sim B(20,0.15)$ distribution.
%%
%%
The blue lines are ``probability'' of interest.
The graphs on the left are the full plot of the distribution, where the graphs on the right are zoomed in on the area of interest.
The top row represents the $X \sim B(20,0.85)$ distribution and the bottom row represents the $Y \sim B(20,0.15)$ distribution.
%%
%%
The blue lines are ``probability'' of interest.
The graphs on the left are the full plot of the distribution, where the graphs on the right are zoomed in on the area of interest.
The top row represents the $X \sim B(20,0.85)$ distribution and the bottom row represents the $Y \sim B(20,0.15)$ distribution.
%%
%%
The blue lines are ``probability'' of interest.
The graphs on the left are the full plot of the distribution, where the graphs on the right are zoomed in on the area of interest.
The top row represents the $X \sim B(20,0.85)$ distribution and the bottom row represents the $Y \sim B(20,0.15)$ distribution.
%%
%%
The blue lines are ``probability'' of interest.
The graphs on the left are the full plot of the distribution, where the graphs on the right are zoomed in on the area of interest.
The top row represents the $X \sim B(20,0.85)$ distribution and the bottom row represents the $Y \sim B(20,0.15)$ distribution.
%%
%%
The blue lines are ``probability'' of interest.
The graphs on the left are the full plot of the distribution, where the graphs on the right are zoomed in on the area of interest.
The top row represents the $X \sim B(20,0.85)$ distribution and the bottom row represents the $Y \sim B(20,0.15)$ distribution.
%%
%%
The blue lines are ``probability'' of interest.
The graphs on the left are the full plot of the distribution, where the graphs on the right are zoomed in on the area of interest.
The top row represents the $X \sim B(20,0.85)$ distribution and the bottom row represents the $Y \sim B(20,0.15)$ distribution.
%%
%%
The blue lines are ``probability'' of interest.
The graphs on the left are the full plot of the distribution, where the graphs on the right are zoomed in on the area of interest.
The top row represents the $X \sim B(20,0.85)$ distribution and the bottom row represents the $Y \sim B(20,0.15)$ distribution.
%%
%%
The blue lines are ``probability'' of interest.
The graphs on the left are the full plot of the distribution, where the graphs on the right are zoomed in on the area of interest.
The top row represents the $X \sim B(20,0.85)$ distribution and the bottom row represents the $Y \sim B(20,0.15)$ distribution.
\end{example}
\cleardoublepage
%\renewcommand{\CoverName}{Back Cover}
%\renewcommand{\thepage}{\CoverName}
\thispagestyle{empty}
\centering
\mbox{}
\vfill
\huge{[This page is intentionally left blank.]
\vfill
\end{document}
See this new MWE, in this file, I have taken on board with the suggestion to put breakable in the tcbset. But if I use it, when there are too many content for the box, it gives an error and does not produce anything. Without the breakable in the tcbset, it compiles but it does not break the content at all.
OP
\documentclass[12pt,a4paper,UTF8]{report}
\usepackage{amsmath,enumerate}
\usepackage[top=1cm, left=1.5cm, right=1.5cm, bottom=1.5cm]{geometry}
\usepackage[unicode]{hyperref}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Example and Solution
%
\usepackage{tcolorbox}
\tcbuselibrary{skins,xparse,breakable}
\tcbset{%
colback=white,
tikz={opacity=0.1,transparency group},
colframe=black,
title filled=false,
% bookmark={Q\arabic{\tcbcounter}}
}
\NewTColorBox[
auto counter,
%number within=section
]{example}{ +O{}mo }{%
fonttitle = \bfseries,
title = {Example~\thetcbcounter:~ #2},
before lower = {\textbf{Solution~\thetcbcounter:\quad}},
% lowerbox = invisible, %invisible/ignored
% after title/after upper
IfValueTF={#3}{after title={\hfill\colorbox{red}{\texttt #3 }}}{},
#1
}%
%%
%% FIX FLOATS
%\makeatletter
%\newenvironment{fixedfigure}
% {\def\@captype{figure}\center}
% {\endcenter}
%\makeatother
%%
%% find the float
%%
%\makeatletter
%\let\old@error\@latexerr
%\def\zzfl@error{Float(s) lost}
%
%\def\@latexerr#1{%
%\def\tmp{#1}%
%\ifx\tmp\zzfl@error
% \def\@elt##1{{%
% \let \protect\noexpand
% \shipout\vbox{\hbox{LOST FLOAT}\hbox{\fbox{\box##1}}}}}%
% \@currlist\@dbltoplist
% \let\@elt\relax
%\fi
%\old@error{#1}}
%\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\section*{Finding the PDF of a function of a continuous random variable}
% [lowerbox = invisible]
\begin{example}[lowerbox = invisible]{}
The continuous random variable $X$ has PDF $\mathrm{f}(x)$ given by
\[
\mathrm{f}(x)
=
\begin{cases}
4x^3 & 0 \leq x \leq 1 \\
0 & \text{otherwise}
\end{cases}
\]
\begin{enumerate}[(a)]
\item Find $\mathrm{F}(x)$.
\item The continuous random variable $Y$ is given by $Y=X^3$.
The cumulative distribution function of $Y$ is denoted by $\mathrm{H}(y)$.
Find $\mathrm{H}(y)$.
\item Find $\mathrm{h}(y)$.
\item Find $\mathrm{P}(X<0.5)$.
\item Find $\mathrm{P}(Y<0.5)$.
\end{enumerate}
%%
%%
\tcblower
%%
%%
\begin{enumerate}[(a)]
\item
\[
\mathrm{F}(x)
=
\int_0^x
4s^3 \, \mathrm{d}s
=
x^4.
\]
Hence
\[
\mathrm{F}(x)
=
\begin{cases}
0 & x<1 \\
x^4 & 0 \leq x \leq 1 \\
1 & x>1
\end{cases}
\]
\item
\[
\begin{aligned}
\mathrm{H}(y)
&= \mathrm{P}(Y \leq y) \\
&= \mathrm{P}(X^3 \leq y) \\
&= \mathrm{P}(X \leq y^{\frac13}) \\
&= (y^{\frac13})^4 \\
&= y^\frac43
\end{aligned}
\]
Hence
\[
\mathrm{H}(y)
=
\begin{cases}
0 & y<1 \\
y^\frac43 & 0 \leq y \leq 1 \\
1 & y>1
\end{cases}
\]
\item
\[
\mathrm{h}(y)
=
\frac{\mathrm{d}}{\mathrm{d}y} \mathrm{H}(y)
=
\frac{4}{3}y^{\frac13}
\]
\[
\mathrm{h}(y)
=
\begin{cases}
\frac{4}{3}y^{\frac13} & 0 \leq y \leq 1 \\
0 & \text{otherwise}
\end{cases}
\]
\item
\[
\mathrm{P}(X<0.5)
=
\mathrm{F}(0.5)
=
0.5^4
=
\frac{1}{16}.
\]
\item
\[
\mathrm{P}(Y<0.5)
=
\mathrm{H}(0.5)
=
0.5^\frac43
=
0.39685
\]
\end{enumerate}
%%
%%
More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text More text
\end{example}
\begin{example}{}
The continuous random variable $X$ has PDF $\mathrm{f}(x)$ given by
\[
\mathrm{f}(x)
=
\begin{cases}
2(1-x) & 0 \leq x \leq 1 \\
0 & \text{otherwise}
\end{cases}
\]
The continuous random variable $Y$ is given by $Y=(1-X)^2$.
\begin{enumerate}[(a)]
\item Find $\mathrm{h}(y)$, the probability density function of $Y$ and name the distribution that it represents.
\item Find $\mathrm{P}(X<0.9)$.
\item Find $\mathrm{P}(Y<0.9)$.
\end{enumerate}
%%
%%
\tcblower
%%
%%
\begin{enumerate}[(a)]
\item
\[
\mathrm{F}(x)
=
\int_0^x
2(1-x) \, \mathrm{d}s
=
2x-x^2
=
\begin{cases}
0 & x<1 \\
2x-x^2 & 0 \leq x \leq 1 \\
1 & x>1
\end{cases}
\]
\[
\begin{aligned}
\mathrm{H}(y)
=
\mathrm{P}(Y \leq y)
=
\mathrm{P}( (1-X)^2 \leq y)
=
1-\mathrm{P}(X \leq 1-\sqrt{y})
=
y
\end{aligned}
\]
Hence
\[
\mathrm{H}(y)
=
\begin{cases}
0 & y<1 \\
y & 0 \leq y \leq 1 \\
1 & y>1
\end{cases}
\]
So
\[
\mathrm{h}(y)
=
\begin{cases}
1 & 0 \leq y \leq 1 \\
0 & \text{otherwise}
\end{cases}
\]
$Y$ is a uniform distribution on $[0,1]$, that is $Y \sim U(0,1)$.
\item
\[
\mathrm{P}(X<0.9)
=
\mathrm{F}(0.9)
=
0.99
\]
\item
\[
\mathrm{P}(Y<0.9)
=
\mathrm{H}(0.9)
=
0.9
\]
\end{enumerate}
%%
%%
\end{example}
\end{document}
See the output of the box, which does not appear to be breakable at all, even with the option \tcbuselibrary{skins,xparse,breakable} enabled.
If I comment out the last texts in the first example, the box goes into the footer like this.

breakable,to the\tcbset, to switch it on. It is initially false (document, 18.3 Main option keys, page 376). Also, remove the[lowerbox = invisible], for obvious reasons. – Cicada Mar 15 '20 at 07:27\newpagebefore the second-last\itemin Example 1 gives a bit of breathing room around the footer. – Cicada Mar 15 '20 at 07:44breakableto the\tcbsetseem to work for the small example, but it caused a nFatal error occurred, no output PDF file produced!for the actual project ...might be a clash with some other package?? – CasperYC Mar 21 '20 at 11:53xin the\begin{document}\end{document}part. – Cicada Mar 21 '20 at 12:02! pdfTeX error (ext4): destinations cannot be inside an XForm.I might open another post for a more specific question. Thanks! – CasperYC Mar 21 '20 at 12:08breakable, to the\tcbsetdoes not seem to be working at all when there istoo muchcontent in the box and it won't compile. I can delete the content and shorten the box, then it compiles. Really don't know where the problem is .... – CasperYC Mar 21 '20 at 12:24texdoc tcolorboxto bring up the manual. – Cicada Mar 21 '20 at 13:01effectofbreakable=unlimitedis clear. It alsoshortenedthe space between and after the boxes. – CasperYC Mar 21 '20 at 15:09%\usepackage{hyperref}, allows breakable boxes. The packages are not playing nice with each other. – Cicada Feb 02 '21 at 09:26NoHyperenvironment (idea from https://tex.stackexchange.com/questions/116338/how-to-turn-on-off-certain-types-e-g-citation-url-file-of-hyperref-links/117676#117676). Works OK. – Cicada Feb 02 '21 at 11:09