KUEZAMEH2M3K6EDHWMYXQMHZ2QTTH4KBM5CO7A7EB64ABEWRE6WQC \newcommand{\V}[0]{\mathcal{V}} % Variables\newcommand{\PV}[0]{\mathcal{V}} % Program variables\newcommand{\F}[0]{\mathcal{F}} % Program variables\newcommand{\Z}[0]{\mathbb{Z}} % whole numbers, integers\newcommand{\GT}[0]{GT} % General transitions\newcommand{\with}[0]{\text{ with }}\newcommand{\union}[0]{\cup}\newcommand{\Union}[0]{\bigcup}\newcommand{\intersect}[0]{\cap}\newcommand{\Intersect}[0]{\bigcap}
\section{Random Variables and distributions.}Since we are talking about probabilistic programs, we will need tools torepresent probabilities throughout the program.A variable in a probabilistic program can take a random value. That means thatthe value assigned to a variable is not deterministic but chosen at randomfrom a given distribution. However, other uses of random variables will arise inthis thesis and we will introduce the concept of random variables in ageneralized manner.The field of probability and random variables is well studied. We will onlyintroduce the core concepts needed to understand this thesis and follow thedefinitions from \cite{alma991005910089706448}. For additional information wewill refere to the literature.\begin{definition}[Probability space]A probability space is a triple $(\Omega,\F,P)$. Where thefollowing holds:\begin{enumerate}\item $\Omega$ is a non-empty set of all possible outcomes and $\omega\in \Omega$ denotes an arbitrary possible outcome.\item $\F$ is the set of events that contains $\Omega$, isclosed under complement, intersection and countable unions. Such aset is also called $\sigma$-field or $\sigma$-algebra.\begin{enumerate}\item $\Omega \in \F$\item For $A\subseteq\Omega$, if $A\in\F$ then so isits complement $A^c\in\F$.\item For $A,B \subseteq \Omega$, if $A, B \in \F$,then so is $A \cup B \in \F$.\item For $ A_1, A_2, \dots,A_n \subseteq \Omega$, if $A_i \in\F$, then so is their union $\Union\limits_{i=1}^nA_i \in \F$.\end{enumerate}\item $P$ assignes a probability to every event and satisfies thefollowing conditions:\begin{enumerate}\item $0 \leq P(A) \leq 1$ for $A \in \F$,\item $P(\emptyset) = 0$, and $P(\Omega) = 1$,\item $ $\todo{invariance of permutation.}\end{enumerate}\end{enumerate}\todo{Refere to a definition of a $\sigma$-algebra.}\end{definition}
For random program variables in this thesis, $\Omega$ will almost certainly bethe set of integers and $\mathcal{F}$ the maximal $\sigma$-field in $\Omega$,the powerset $2^\Omega$. Other values of $\Omega$ are possible like the setof all runs in a program, that can also be taken as outcomes of a randomsampling.\begin{definition}[Random variable]A random variable assignes a probability\end{definition}A discrete bounded probability distribution gives a probability to everypossible integer and can be seen as a function $q: \Z \mapsto [0,1]$ where allvalues of $q$ add up to $1$, that is $\sum_{x\in\Z} q(x) = 1$.Common operations can be defined over probability distributions as well, whichwill be very handy in probabilistic integer programs. Given two probabilitydistributions $p$, and $q$, the following operations are defined:\begin{equation*}p \diamond q (x) = \sum_{\substack{i,j \in \Z \\ i \diamond j = x}} p(i)\cdot q(i) \hspace{1cm} \with \diamond \in \{+, \cdot\}\end{equation*}\todo{more operators?}In the context of this thesis the discrete bounded distributions will be used todescribe the possible values of a variable. They can be used as if they werenon-probabilistic values, for exymple andIt can be used inside theA note non-probabilistic (fixed) value $k$ is equivalent to a distribution whichassignes the probability $1$ to this fixed value $k$ and $0$ to every othervalue.program itself during assignments when setting a new value to a variable orduring analysis to describe the possible values of the variables at a certainconfiguration.\[p_k(x) = \begin{cases}1, & x = k \\0, & \text{otherwise}\end{cases}\]The resulting
\item an update function $η : \PV \mapsto \Z[\V] \cup D$, mapping everyprogram variable to a polynomial or a bounded distributionfunction. All $t \in g$ must share the same start location$l$, guard $τ$.
\item an update function $η : \PV \mapsto \Z[\V] \cup D$,mapping every program variable to a polynomial or a boundeddistribution function. All $t \in g$ must share the samestart location $l$, guard $τ$.
% TODO: examples\subsection{Semantics}A configuration is a tuple of a location and a variable assignment $(l, \sigma)$that stands for a specific state of a running program. Given a startingassignment for the program variables (the input to the program), the programis evaluated starting from the start location $l_0$.An execution path of a program is a sequence of configurations, where the firstconfiguration is the starting configuration. Note that at this point it isunclear what a valid
% TODO: examples
One can take two vies to the evaluation ofLet's define the semantics of propabilistic integer programs. We will take twoviews onto the semantics of integer programs. First the intuitive one and seconda more formal definition.\todo{introduce variables, assignments, constraints, polyhedron}The curent configuration is represented as a tuple $(l_0, c_0)$.An execution path is a sequence of configurations.\subsection{Runtime}\begin{comment}for a transition:- constant cost- most simple case cost = 1 for every transition- combining transitions and adding costs- costs depending on variablesfor a prefix:- finite sequence of configurations- runtime = sum of all costs over all steps in the prefix- probability = product over all transition probabilities in the prefix- legal prefix = non-zero probabilityfor a path:- infinite sequence of configurations- runtime = runtime of the largest non-zero probability prefix- prolegal paths = paths with a non-zerofor a program:- supremum over runtime of all paths\end{comment}\begin{definition}[Runtime of a run]\end{definition}\begin{definition}[Worst-case runtime of a Program]\end{definition}\begin{definition}[Expected runtime of a Program]\end{definition}
Transform a program into an equivalent program. \todo{define equivalence ofprograms}