\section{Discussion}
\label{sec:discussion}

This section contains discussion of all the parts of this chapter, particularly the nature of the techniques employed, the nature of the mechanisms discovered and the experimental effectiveness of them in the context of synthetic data.
\begin{itemize}
\item	in subsection \ref{subsection:discussion_EBB} we discuss the nature and effectiveness of our derived EBB from section \ref{section:new_EBB}.
\item	in subsection \ref{subsection:main_discussion} we discuss the performance of our new SEBM method, in the context of synthetic data
\item	in subsection \ref{subsection:discussion_shapley} we discuss the performance of our SEBM method in the context of sampling the Shapley Value.
\item	in subsection \ref{sec:multi} we give indication of future work regarding the extension of SEBB to multidimensional data, and conclude.
\end{itemize}

\subsection{The effectiveness of our new EBB}\label{subsection:discussion_EBB}

In section \ref{section:new_EBB} we went through the process of deriving an EBB using complex components, thus yielding a requirement for its numerical determination.
The resulting numerical EBB was then fitted with a symbolic envelope for ease of use - per equation \ref{eq:prob_bound}.

It is interesting to compare the strength of the new EBB against other EBBs, particularly we considered that most of the elements in our new EBB were improvements upon the process used in the derivation of Maurer and Pontil's EBB.

And so we compared our EBB directly with \cite{Maurer50empiricalbernstein}'s EBB given by theorem \ref{MandPsEBB} as:
$$\p\left(\mu-\hat{\mu}\ge\sqrt{\frac{2\hat{\sigma}^2\log(2/t)}{n}}+\frac{7D\log(2/t)}{3(n-1)}\right)\le t$$
We felt that it would only be fair to compare our EBB to Maurer and Pontil's EBB if they had applied Popoviciu's inequality as an appropriate domain restriction and carried it through their derivation, as we did to our own EBB.
Specifically, this is the domain where:
\[ \frac{1}{2}>\frac{\sqrt{\hat{\sigma}^2}}{D}+\sqrt{\frac{2\log(2/t)}{n-1}} \]
We plotted the improvement our EBB offers in this domain, as shown in Figure \ref{biggraph3}.

In this plot, a probability 0.5 bound is shown to shrink by approximately one third.
And we observed that our refinement of Maurer and Pontil's EBB was uniformly tighter across a large range of values.

\input{figs/ebb_strength.tex}

While this may be an interesting result, we also sought to put this in perspective with what could ideally be achieved.
And so we conducted a comparison about the further improvement over our EBB that might be achieved with perfect information about the variance; specifically that, Bennett's inequality is used assuming $\hat{\sigma}^2=\sigma^2$.
The improvement that Bennett's inequality (with perfect variance information) has over our EBB is plotted in Figure \ref{biggraph4}, which shows that when the variance is small, uncertainty about the variance is the most detrimental to an EBB, such as ours.
However, it is witnessed that loosely going from our EBB to perfect variance information shrinks the bound by about another third.
In this way (although the results are loose) we can witness that our EBB provides approximately a half-way mark from existing state-of-the-art EBBs to an impossible ideal of having perfect variance information.

The purpose of developing a stronger EBB was to see if it could be used to improve the selection of samples in the context of stratified sampling (particularly of the Shapley Value) over other EBBs.
It was expected that the better and more tight the EBBs used, the more likely it would be that iteratively choosing samples to minimise such a bound would produce better sample choices and thus yield better estimate of the population mean.

And while it is evident that the EBB we produced was tighter than Maurer and Pontil's EBB, the actual resulting performance difference in selecting samples (as seen between \textsc{EEBB} and \textsc{Maurer} in Table \ref{Table1}) is surprisingly marginal; so marginal in fact, it was comparable to the performance of using unioned Hoeffding bounds - the \textsc{Hoeffding} method.
We continue discussion of this surprising result in the context of all the other methods in the next section \ref{subsection:main_discussion}.

\subsection{Discussion of stratified sampling results}\label{subsection:main_discussion}

The results for our different sampling methods are shown across Figures~\ref{Table1},\ref{Table111} and \ref{biggraph3}, with the main observation that most of the techniques performed well and similar to Neyman sampling, and that our sampling technique (including SEBM (or SEBM-W) and SECM) performed competitively to Neyman sampling (\textsc{Ney} or \textsc{Ney-W}) despite not having access to knowledge of strata variances.

It is also observed that Neyman sampling was ultimately the most accurate, for reasons that were hinted in section \ref{sec:neyman_sampling}.
Particularly that if sufficient samples have been taken then the sample means of the strata will tend to approximately be Gaussian distributed by the Central Limit Theorem.
In this context the strata means have a distribution that is entirely characterised by their mean and variance, and hence so too is the population mean estimate.
Thus the variance of the sampled population mean is the only parameter determining its error, and minimising it directly translates into improved accuracy.
The fact that the variances of the strata are the only parameters determining the error in the stratified sampling process is most directly exploited by Neyman allocation but is more obscured in SEBM* allocation methodology (as it is based only on a simplification of Bennett's inequality), thus leading to slightly worse results, particularly in Figure \ref{biggraph3}.

However this mode of explanation is perhaps the underlying reason for the similarity in performance of many of the other methods as well, particularly that after sufficiently many samples have been taken the sample means of all of the strata become Gaussian distributed and the performance of the methods then depend primarily on how effectively they estimate the variances of the strata and then allocate accordingly.
Perhaps in our Beta synthetic data there was not sufficient spread of data variances for it to make significant difference how effectively this variance estimation and allocation was done.

%One of the most remarkable inferences from the data is just how very readily Central Limit Theorem dynamics emerges, from Figure \ref{fig:central_limit_theorem} we can see that the sample error of uniformly distributed data converges almost perfectly to a Gaussian distribution even in just 4 samples.

Conversely the Bernoulli-uniform synthetic data was specifically designed to create a significant spread in variance between the strata.
And the results (plotted in \ref{biggraph3}) reveal the design to amplify the detriment in stratified sampling that uncertainty about the variances would yield.
In this context Neyman sampling is very efficient as it samples based on perfect variance information, and reversely our method SEBM performs worse as it extends from minimising only a simplification of Bennett's inequality under uncertainty of the variance - this is most evident in figure \ref{biggraph3}.
Because of this uncertainty about the variance, the more infrequent the Bernoulli outlier, the more likely that the methods without variance information would over-sample the Bernoulli stratum - which they did.
The relative inefficiency of the SECM method is also interesting, particularly as it sought to minimise Chebyshev's inequality for the stratified sampling, and under perfect variance information would be identical to Neyman sampling.
The implication in this context is that the inefficiency of utilising these methods primarily extends from uncertainty about the variances of the strata and how to integrate it.

From between Figures~\ref{Table1} and \ref{Table111} we observe that sampling without replacement always performs better than sampling with replacement for the same method, and this improvement is magnified as the number of samples grows large relative to the size of the population.
At the same time, simple \textsc{Random} sampling almost always performs worst, because it fails to take advantage of any variance information, and \textsc{Simple} sampling performs even worse as it fails to take into account data stratification, these results are as expected.
Therefore from the Figures ~\ref{Table1} and \ref{Table111} we see that the primary increase in performance comes from employing stratified sampling over simple sampling, sampling without replacement over sampling with replacement, and then using some method that is more intelligent than randomly selecting samples (ie. \textsc{Random} method) and preferably using stratum variance information to get close to the ideal of Neyman sampling.

Aside from comparing the different performances of these bounds as a target for minimisation by selective sampling, it also was seen to be productive to consider them on their own - simply as bounds on the stratified mean error.
Particularly we can see a range of different strengths of the bounds in Figure \ref{fig:bounds_widths}.

In Figure \ref{fig:bounds_widths} we have plotted the bound widths of the various probability bounds of this paper in the context of the Beta-distributed data we considered in section \ref{sec:beta_distributed_data} achieved after a sample budget $n=50N$ samples allocated using \textsc{Ney-W} method.
In this graph we considered the following bounds for the error:

\begin{itemize}
\item
\textsc{Ney-B} The bound attained using knowledge of the variances of the strata using Chebyshev's inequality (Theorem \ref{thm:chebyshevs}) in conjunction with the additivity of variance rule (Equation \ref{eq:variance_decomposition_for_strata_mean})
\item
\textsc{SEBB*} The bound of Theorem \ref{thm:1} with variance knowledge of the variances, also using sampling without replacement sharpening (Theorem \ref{martingale0}) where optimal.
\item
\textsc{SEBB*-W} The bound of Theorem \ref{thm:1} with variance knowledge of the variances, not using sampling without replacement sharpening (Theorem \ref{martingale0}).
\item
\textsc{SECB} The bound of Theorem \ref{thm:SECM_bound}, which utilises Chebyshev's inequality together with our probability bound on error deviation.
\item
\textsc{SEBB} The bound of Theorem \ref{thm:SEBM_bound}, using sampling without replacement sharpening (Theorem \ref{martingale0}) where optimal.
\item
\textsc{SEBB-W} The bound of Theorem \ref{thm:SEBM_bound}, not sampling without replacement sharpening (Theorem \ref{martingale0}).
\item
\textsc{Hoeffding-B} The bound attained by Hoeffding's inequality (Theorem \ref{Hoeffdings_inequality_proper}) for the strata, unioned together (via Theorem \ref{triangle_theorem2}) to create a bound on the stratified sampling error.
\item
\textsc{Audibert-B} The bound attained by Audibert et.al's EBB inequality (Theorem \ref{AudibertsEBB}) for the strata, unioned together (via Theorem \ref{triangle_theorem2}) to create a bound on the stratified sampling error.
\item
\textsc{Maurer-B} The bound attained by Maurer and Pontil's EBB inequality (Theorem \ref{MandPsEBB}) for the strata, unioned together (via Theorem \ref{triangle_theorem2}) to create a bound on the stratified sampling error.
\end{itemize}

Particularly we see from Figure \ref{fig:bounds_widths} that tightest bounds are given by those methods which are rooted in perfect variance information, and the widest bounds are given by those methods which utilise probability unions to bind EBBs together (via Theorem \ref{triangle_theorem2}).
What is most notable is the dissimilarity between the widths of the bounds and their effectiveness as a target for sampling minimisation; as choosing samples to minimise a probability bound is sensitive to the shape of the bound, not its magnitude.
Also comparing this Figure \ref{fig:bounds_widths}, with Figures \ref{Table1},\ref{Table111} we can see that the width of the bounds are much wider than the magnitudes of the error which are actually achieved; and this is quite expected, as analytic concentration inequalities function as conservative confidence intervals on the error of sampling.

%\input{figs/convolution_graph.tex}
\input{figs/widths_graph.tex}

%Next, note that the results of Figure~\ref{Table1} show that there is a mid-range of sample sizes where choosing a different method can even have a greater impact on sampling efficiency and rate of average error reduction than the difference between sampling with or without replacement.
%This is an important insight, as sampling real-world data (e.g. surveys, polling, destructive testing, etc) can be an expensive and slow process.
%Accordingly an appropriate method of choosing numbers of samples can lead to a material difference in cost for the same accuracy.
%There is also a slight decrease in the performance of SEBM* in comparison with \textsc{Ney} in the case of high number of samples and sampling without replacement, as illustrated in Figure~\ref{Table1}.
%This indicates that the use of sub-optimal equation~\ref{approx1} in the derivation of Lemma~\ref{martingale0} might have some negative effect, by distorting the shape of the functions that the sampling processes then minimizes.

%If the data features very rare events, then SEBM and SEBM* seem to perform in a manner less than ideal.
%These condition are illustrated in Figure~\ref{biggraph3}, where the more rare the Bernoulli variable successes, the worse our methods perform in comparison with Neyman sampling (\textsc{Ney}).
%This shortcoming can be partly explained by noting that SEBM unnecessarily wastes samples on the Bernoulli stratum of rare events in the process of learning that the variance is almost zero, whereas \textsc{Ney} can avoid this because it has prior knowledge of the variances to begin with.
%As such, this factor explains the difference between the performance of SEBM and SEBM* in the context of Figure~\ref{Table1} and also in Figure~\ref{biggraph3}.
%What is surprising is how small the difference in performance between SEBM and SEBM* is.
%This indicates that as additional samples are taken, the original uncertainty about the strata variances have less and less effect upon the total numbers of samples that are eventually drawn from each of the strata.

%However, the performance difference between SEBM* and \textsc{Ney} in Figure~\ref{biggraph3} is not explained by this argument, as they use the same information.
%Instead, the reason for this difference in performance is found by considering the simplifying approximation of Equation \eqref{eq:part2} in the derivation of Lemma~\ref{expectation1}.
%Specifically, \eqref{eq:part2} introduces a particular distortion into the shape of Equation~\eqref{big_equation} which our sampling seeks to minimize.
%Figure~\ref{fig:graph2} illustrates how the approximation \eqref{eq:part2} loosens the bound with respect to the variance.
%Observe that when the variances are very small that Equation~\eqref{eq:part3} overly loosens the bounds, causing oversampling of strata with very small variances.
%It appears that this factor is at play in the under-performance shown in Figure~\ref{biggraph3} and also the slight under-performance of our method in the Voting Game in Table~\ref{tab2}.
%We note that there may be other corner-cases where our method also under-performs.

\subsection{Discussion of Shapley Value results}\label{subsection:discussion_shapley}

In considering the comparison of approaches to approximating the Shapley Value, our sampling method (SEBM, with error $e^{SEBM}$) shows improved performance on almost all accounts, as shown in Table~\ref{Table2}.
This was particularly the case in the context of large sample budgets, as our method sampled without replacement, while the other methods sampled with replacement.
And we also note that our method's performance could potentially be further improved by selecting more refined $D_i$ values in the context of our example games.

We attribute our methods success in estimating the Shapley Value primarily to the design decisions used in the creation of those other methods.
Particularly we note that Castro's Neyman sampling method (with error $e^{Ca}$) deploys about half the samples learning about the variance and the other half using a Neyman style allocation.
The choice of allocating half the samples was identified as a default by Castro with the acknowledgement that the proportion should be treated as a tunable parameter depending on the particular context of the cooperative game.
However, to make a fair comparison did not tune any such parameters for any of the methods.

In the process of generating these results one of the major effects that was witnessed in our sampling method (SEBM) was the computational overhead of iteratively minimising (one sample at a time) our inequality (equation \ref{big_equation}) in the context of our simple example games.
Although we acknowledged and expected a computational overhead, we designed our method with the intention of using it to approximate the GNK value (per section \ref{sec:sampling_techniques}), where each additional sample requires running an optimisation problem, and in this context a computational overhead about which sample to choose was deemed less relevant.

%\input{figure-22.tex}

One primary limitation of our method(s) is that it rests on assumption of known data widths $D_i$ (and in the case of sampling-without-replacement, also on strata sizes $N_i$), which may not be exactly known in practice.
One way to overcome this may be to use our method with a reliable overestimate these parameters (by expert opinion or otherwise) and such estimation may itself open consideration of other probability bounds and/or sampling methods.
Conversely, it might also be advisable to run our method with an underestimate of the data widths, as in-practice the sampling process is fundamentally sensitive to the shape of the inequality and not necessarily its magnitude or accuracy as a bound.

% Our concentration inequality, Equation~\eqref{big_equation}, is derived by a combination of Chernoff bounds fused together with probability unions, so it is expected to give conservative confidence intervals on the error of the estimate in stratified random sampling, which may be useful outside of the context of sampling decisions.

\section{Conclusion and Summary: applications of a multidimensional extension}\label{sec:multi}

It was noticed that our SEBB can be extended to multidimensional data by a simple modification.
Specifically, instead of considering data that is single-valued, we consider data points that are vectors.

Formally, for $n$ strata of finite data points which are all vectors of size $M$, let $n_i$ be the number of data points in the $i$th stratum.
Let the data in the $i$th stratum have a mean vector values $\mu_i$ (with $\mu_{i,j}$ for the $j$th component of the vector), which are value bounded within a finite width $D_{i,j}$, and have vector value variances $\sigma_{i,j}^2$.
Given this, let $X_{i,1},X_{i,2},\dots,X_{i,n_i}$ (where $X_{i,k,j}$ is the $j$th component, of the $k$th vector from stratum $i$) be vector random variables corresponding to those data values randomly and sequentially drawn (with or without) replacement.
Denote the average of the first $m_i$ of these random variables from the $i$th stratum by $\chi_{i,m_i}= \frac{1}{m_i}\sum_{k=1}^{m_i}X_{i,k}$ (with $\chi_{i,m_i,j}$ being the $j$th component of that vector average).
Let $\doublehat{\sigma}_{i,j}^2=\frac{i}{m_i-1}\sum_{k=1}^{m_i}(X_{i,k,j}-\chi_{i,m_i,j})^2$ be the unbiased sample variance of the first $m_i$ of these random variables in the $j$th component.
As before, we assume weights $\tau_i$ for each stratum. \\
In this context we have the following theorem:

\begin{theorem}[Vector SEBM bound]
In the context above, then with $\Omega_{m_i}^{n_i},\Psi_{m_i}^{n_i}$ per Lemma~\ref{martingale1}:
%\begin{equation}\label{big_equation2}\p\left(\begin{matrix*}[l]\sum_{j=1}^M\left(\sum_{i=1}^n\tau_i(\chi_{i,m_i,j}-\mu_{i,j})\right)^2 \ge \\ \quad\quad \log(6/p)\sum_{j=1}^M\begin{pmatrix*}[l]\sum_{i=1}^n\frac{4}{17}\Omega_{m_i}^{n_i}D_{i,j}^2\tau_i^2 \\ +\begin{pmatrix*}[l]\sqrt{\log(3/p)\left(\max_i\tau_i^2{\Psi_{m_i}^{n_i}}^2D_{i,j}^2\right)} \\ +\sqrt{\begin{matrix*}[l]2\sum_{i=1}^n\tau_i^2\Psi_{m_i}^{n_i}(m_i-1)\doublehat{\sigma}_{i,j}^2/m_i \\ + \log(6n/p)\sum_i\tau_i^2D_{i,j}^2\Omega_{m_i}^{n_i}\Psi_{m_i}^{n_i} \\ +\log(3/p)\left(\max_i\tau_i^2{\Psi_{m_i}^{n_i}}^2D_{i,j}^2\right)\end{matrix*}} \end{pmatrix*}^2\end{pmatrix*}\end{matrix*} \right)\le Mp \end{equation}

\begin{equation}\label{big_equation2}\pr\left(\begin{matrix*}[l]\sum_{j=1}^M\left(\sum_{i=1}^n\tau_i(\chi_{i,m_i,j}-\mu_{i,j})\right)^2 \ge \\ \quad\quad \log(6/p)\sum_{j=1}^M\left(\alpha_{m_i,j}^{n_i} +\left(\sqrt{\beta_{m_i,j}^{n_i}} +\sqrt{\gamma_{m_i,j}^{n_i}}\right)^2\right)\end{matrix*} \right)\le Mp \end{equation}

where:

\begin{align*}
\alpha_{j}=&\sum_{i=1}^n\frac{4}{17}\Omega_{m_i}^{n_i}D_{i,j}^2\tau_i^2 \\
\beta_{j}=&\log(3/p)\left(\max_i\tau_i^2{\Psi_{m_i}^{n_i}}^2D_{i,j}^2\right) \\
\gamma_{j}=&2\sum_{i=1}^n\tau_i^2\Psi_{m_i}^{n_i}(m_i-1)\doublehat{\sigma}_{i,j}^2/m_i
+ \log(6n/p)\sum_i\tau_i^2D_{i,j}^2\Omega_{m_i}^{n_i}\Psi_{m_i}^{n_i}  \\
&\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad~~+\log(3/p)\left(\max_i\tau_i^2{\Psi_{m_i}^{n_i}}^2D_{i,j}^2\right)
\end{align*}

%$$
%\alpha_{m_i,j}^{n_i}
%=\sum_{i=1}^n\frac{4}{17}\Omega_{m_i}^{n_i}D_{i,j}^2\tau_i^2
%$$
%$$
%\beta_{m_i,j}^{n_i}
%=\log(3/p)\left(\max_i\tau_i^2{\Psi_{m_i}^{n_i}}^2D_{i,j}^2\right)
%$$
%and
%\begin{align*}
%\gamma_{m_i,j}^{n_i}
%= 2\sum_{i=1}^n\tau_i^2\Psi_{m_i}^{n_i}(m_i-1)\doublehat{\sigma}_{i,j}^2/m_i
%&+ \log(6n/p)\sum_i\tau_i^2D_{i,j}^2\Omega_{m_i}^{n_i}\Psi_{m_i}^{n_i}  \\
%&+\log(3/p)\left(\max_i\tau_i^2{\Psi_{m_i}^{n_i}}^2D_{i,j}^2\right)
%\end{align*}

\end{theorem}
\begin{proof}
Squaring \eqref{big_equation} and applying it specifically to the $j$th component of all the vectors gives:
\begin{equation*}
\pr\left(\frac{\left(\sum_{i=1}^n\tau_i(\chi_{i,m_i}-\mu_i)\right)^2}{\log(6/p)}
\ge \alpha_{j}
+ \left(\sqrt{\beta_{j}}
+ \sqrt{\gamma_{j}}\right)^2  \right)
\le p
\end{equation*}
%$$ \p\left(\frac{\left(\sum_{i=1}^n\tau_i(\chi_{i,m_i,j}-\mu_{i,j})\right)^2}{\log(6/p)}\ge \begin{matrix*}[l]\sum_{i=1}^n\frac{4}{17}\Omega_{m_i}^{n_i}D_{i,j}^2\tau_i^2 \\ +\begin{pmatrix*}[l]\sqrt{\log(3/p)\left(\max_i\tau_i^2{\Psi_{m_i}^{n_i}}^2D_{i,j}^2\right)} \\ +\sqrt{\begin{matrix*}[l]2\sum_{i=1}^n\tau_i^2\Psi_{m_i}^{n_i}(m_i-1)\doublehat{\sigma}_{i,j}^2/m_i \\ + \log(6n/p)\sum_i\tau_i^2D_{i,j}^2\Omega_{m_i}^{n_i}\Psi_{m_i}^{n_i} \\ +\log(3/p)\left(\max_i\tau_i^2{\Psi_{m_i}^{n_i}}^2D_{i,j}^2\right)\end{matrix*}} \end{pmatrix*}^2\end{matrix*} \right)\le p $$
Taking a series of union bounds (Lemma~\ref{prob_union}) over $j$ gives result.
\end{proof}

The left hand side of the inequality in \eqref{big_equation2} is the square Euclidean distance between our weighted stratified sample vector estimate $\sum_{i=1}^n\tau_i\chi_{i,m_i}$ and the true mean stratified vector $\sum_{i=1}^n\tau_i\mu_{i}$.
In this context, an example sampling process might consist of sampling to maximally minimise the right hand side of the inequality (similar to our SEBM process, described in Section~\ref{sec:SEBMalgorithm}).
This formulation can be applied to more involved computational tasks that involve approximating averages over large sets of data with multiple features or auxiliary variables.

Potentially the application of our multi-dimensional extension of the SEBB to a range of tasks (such as neural network minibatch smart sampling) could be quite rewarding.

\subsection{Chapter Summary}

Stratified sampling is a well known example of a statistical process of estimating a population mean by breaking it into strata, and then sampling the mean of each of the strata.
Our primary investigative question of this chapter was how best to choose samples from the strata to get most accuracy in the final population estimate.
To do this investigation we considered different means of estimating the error in the final population estimate - these took the form of analytically derived concentration inequalities.
These concentration inequalities were developed and then the process of sampling to minimise them formed a sampling methodology, which was evaluated.

In the first part of this chapter, Section \ref{sec:sampling_background}, we introduced the problem of stratified sampling, and a few statistical lemmas.
Afterwards we considered different possible EBBs as a way of bounding the error in the context of stratified random sampling, and for this purpose developed a new EBB, in Sections \ref{section:old_statistics} and \ref{section:new_EBB}.
This process of using EBBs involved binding EBBs applied to different strata together using union bounds to create a bound on the stratified sample mean error (via Theorems \ref{triangle_theorem1} or \ref{triangle_theorem2}).

From this investigation we learned that it was possible to create stronger bounds for stratified sampling (which dont use as many union bounds as there are strata), which in the next part of this chapter we developed, in Section \ref{section:SEBB}.
These sampling methodologies were then evaluated on synthetic data sets in Section \ref{section:statistics_results}, and discussed in Section \ref{sec:discussion}.

Our resulting concentration inequality (SEBB) gives an analytic bound on the error of the stratified mean and explicitly considers the sample variances, data widths, sample numbers, and any additional weights on the strata; and includes factors specifically for strata sampled with and/or without replacement.
It is complex and tailored specifically to stratified sampling, and performs well in the sampling of synthetic data sets.

The relevance of this new method of doing stratified sampling, has wider relevance, but also relevance to sampling the Shapley Value (or solution concepts similar to it such as the GNK value, as in Section \ref{sec:sampling_techniques}) in electricity network contexts.

%In the derivation of the SEBB we primarily utilised Chernoff bounds, however it is possible that stronger bounds can potentially be derived.
%Particularly optimal uncertainty quantification (OUQ) can result in perfectly tight bounds on concentration, directly by solving for the worst case scenario directly, we are skeptical about how this could be made to apply to stratified sampling particularly, but potentially it is worth investigation.\citep{OUQ1,doi:10.1137/13094712X}

%The derivation of our inequality extends from consideration of Chernoff bounds and probability unions in a similar vein to other EBB derivations \citep{Maurer50empiricalbernstein,bardenet2015}.
%, however we do not argue that our particular concentration inequality is ideal.
%However, the bounds on the moment generating functions that we developed in Section~\ref{sec:components} use loosening approximations, and hence stronger and/or more representative bounds could be developed at the cost of greater mathematical complexity.
%Alternatively, an approach utilizing entropic \citep{Boucheron_concentrationinequalities} or Efron-Stein inequalities \citep{efron1981} could result in different and potentially tighter results.

% Full exploration of the potential applications are beyond the scope of this document.
% However, at present, we are pleased to present our analytic concentration inequality (Equation \ref{big_equation}) as an immediately computable expression and practical method for choosing samples from strata.


\section{AirBnb Price Estimator App}

\subsection{Introduction}
\textbf{AirBnB Price Estimator} is a real estate cost estimation application in which the Users have the possibility to worth their own Bed and Breakfast simply by inserting some information related to it, in a very simple and fast way.

\subsection{Use Cases List}
There is no need for registration or authentication, every user can operate with the applicative as they open it.
The can:
\begin{itemize}
	\item Select the classifier they want to predict the price of their B\&B between:
		\subitem - \textit{Random Forest}
		\subitem - \textit{M5Rules}
	\item Insert the requested values for B\&B related characteristics
	\item Estimate the most suitable price using the algorithm previously selected
\end{itemize}

\subsection{Application Guide}
When the application is launched a window is opened telling the \textbf{User} to choose between the two classifiers previously discussed. The User cannot undo the choose, once selected the classifier, in order to change it he/she must reopen the application.
Selected the classifier, a new scene is loaded. This scene displays some \textit{Text Fields} and
\textit{Radio Buttons}, corresponding to the subset of the overall features in out dataset that have been chosen by the \textbf{Attribute Selection process} (see chapter 3.3).
If a Radio Button is not selected the system will understand that as the absence of the particular amenity the Radio Button refers to.
After the \textbf{User} inputs all the values, a \textit{Button} called \textit{"PREDICT PRICE"} is located at
the button of the window (scroll down if you don't see it). A click on it will display in a label the predicted price, just below the Button.
The user can perform multiple predictions sequentially, just changing the contents of the \textit{Text Fields} or the selection of the \textit{Radio Button}s.

\subsection{Implementation Details}
\subsubsection{Technologies}
In order to ensure a higher level of accessibility to the users, we decided to adopt the \textbf{JavaFx} framework to create a very simple and intuitive \textit{Graphical User Interface}.
For what concerns the prediction system, we used again the \textit{Java Weka API} so that to make use of the model stored on the previous phases, with no need to compute it again.

\subsubsection{Input Validation}
To make the usage of the application easier, the User is not required to know the exact format of the nominal attributes, indeed such a property is ensured by an input validation system.
In fact, to standardize the nominal attributes, in the preprocessing step we unified the format that is:
\begin{itemize}
	\item First letter uppercase
	\item No other letter can be uppercase
	\item All the special characters, included the blank space, are replaced by the underscore
\end{itemize}

After the user clicks the \textit{“PREDICT PRICE”} button, those operations are performed again on the input data. Anyway, the system is not capable of recognizing misspelled words and replacing it (\textbf{e.g}, If the use writes \textit{Alerton} instead of Allerton, the system will recognize it as a value out of the admitted range of the nominal attribute).

\subsubsection{Model Loading and Prediction}
When the user clicks on the classifier he/she wants to use, automatically the system loads it, through the \textit{Weka Api} function \textbf{SerializationHelper.read(File)}. Once loaded, it is kept in memory for the application lifespan, so that to speed up multiple predictions performed one after the other. After that, all the attributes that the classifier needs are passed to the GUI, which generates a new input field for each of them (a Radio Button for the binary ones, a \textit{Text Field} for all the others). The prediction of the price is made through the function \textbf{Classifier.classifyInstance(Instance)} that returns a double value. After the 2-decimal rounding, the value is output to the user.


\documentclass[letterpaper,preprint,aps,pra,superscriptaddress]{revtex4-1}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{units}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{wasysym}
\usepackage{braket}

\def\kr{k_{\rm R}}                            				% kr
\def\Er{E_{\rm R}}                            				% kr

\def\ex{\mathbf{e}_x}
\def\es{\mathbf{e}_s}
\def\ey{\mathbf{e}_y}
\def\ez{\mathbf{e}_z}

\usepackage{babel}
\begin{document}

\title{Diffraction based DMD wavemeter}

\author{I. B. Spielman}
\affiliation{Joint Quantum Institute, National Institute of Standards and Technology,
and University of Maryland, Gaithersburg, Maryland, 20899, USA}

\date{\today}
\begin{abstract}
Here I have some notes describing the physics of a wavemeter based on a DMD.
\end{abstract}
\maketitle

There are two basic types of wavemeters:  using the photon nature of light and using the wave-nature of light.  Generally the latter rely on $E=h\nu$, giving the energy $E$ of a photon of frequency $\mu$ in terms of Planks constant.  The principle of operation is the measure the per-photon energy, for example a bolometer that measures the change in temperature.  I contrast most laboratory wavemeters use some form of interference or wave counting to infer the wavelength or wavenumber.

\section{Basic operation}

\begin{figure}
\includegraphics{Schematic}
\caption{Schematic of Bragg scattering from a grating.  An incoming laser with wavevector ${\bf k}_i$ is (possibly) scattered into outgoing beams with wavevector ${\bf k}_f$.}
\label{fig:Grating_Schematic}
\end{figure}

At its core, this device is a grating spectrometer that leverages the angular dependance of Bragg scattering from a diffraction grating to extract the optical wavelength.  Figure~\ref{fig:Grating_Schematic} depicts the basic process of scattering fields off of an array of scatters spaced by a distance $d$ which are infinite along $\ey$.

\subsection{Bragg Scattering}

I will begin by deriving the relationship between the incident and scattered waves.  We consider an optical field with wavelength $\lambda$ and wavenumber $k_0 = 2\pi/\lambda$ incident at an angle $\theta_i$ on an 1D diffraction grating described by
\begin{align}
E_{\rm init}({\bf x}) &= E_0 \exp\left[i k_0 (\sin\theta_i \ex - E_i \cos\theta_i\ez)\cdot{\bf x} \right]
\end{align}
If we focus on just one element of the grating labeled by $j$, it will produce a scattered field
\begin{align}
E_j(x,y,z=0) &= E_0 f(x-dj;\theta_i) \exp\left[i k_0 d j \sin\theta_i \right]
\end{align}
at $z=0$.  The first term in this expression $f(x;\theta_i)$ is the scattered field at $z=0$ for an incident field at angle $\theta_i$, in the expression it is evaluated at $x-dj$ the center position of the $j$'th element of the array.  The second term accounts for the position-dependent phase of the incident optical field in the plane of the grating.  Summing these up for all the scatterers gives
\begin{align}
E(x,y,z=0) &= E_0 \sum_j f(x-dj;\theta_i) \exp\left[i k_0 d j \sin\theta_i \right].
\end{align}
At this point we are essentially done, and the last step is to take he Fourier transform of this expression
\begin{align}
\tilde E({\bf k}_{\rm 2D},z=0) &= E_0 \sum_j \int d^2 {\bf x}_{\rm 2D} f(x-dj;\theta_i) \exp\left[i (k_0 d j \sin\theta_i - {\bf k}_{\rm 2D}\cdot{\bf x}_{\rm 2D}) \right] \\
&= E_0 \sum_j \int d^2 {\bf x}_{\rm 2D} f(x;\theta_i) \exp\left\{i [(k_0 \sin\theta_i - k_x) d j - {\bf k}_{\rm 2D}\cdot{\bf x}_{\rm 2D}] \right\}\\
&= E_0 \tilde f({\bf k}_{\rm 2D};\theta_i) \sum_j \exp\left[i (k_0 \sin\theta_i - k_x) d j \right].
\end{align}
There is just one more step, but I wanted to comment at this point that the overall form-factor $\tilde f({\bf k}_{\rm 2D};\theta_i)$ is now controlling the overall shape of the scattered field (which is why it is called a form-factor).  Last, we sum over all of elements of the grating, which in the infinite limit produces a chain of delta functions describing outgoing orders labeled by $\ell$
\begin{align}
\tilde E({\bf k}_{\rm 2D},z=0) &\propto \tilde f({\bf k}_{\rm 2D};\theta_i) \sum_\ell \delta[(k_0 \sin\theta_i - k_x) d - 2\pi\ell].
\end{align}
Thus we find scattered beams when $(k_0 \sin\theta_i - k_x) d = 2\pi\ell$, since we know that $k_y=0$ (this will be from the form factor, which will take the form $\tilde f({\bf k}_{\rm 2D};\theta_i) = \tilde f(k_x;\theta_i) \delta(k_y)$ because it was independent of $y$ in coordinate space.  To finish the story, we know that the total wavenumber is $k_x^2 + k_z^2 = k_0^2$ so we can dived our scattering condition by $k_0$ to arrive at the Bragg condition
\begin{align}
\sin\theta_i - \frac{k_x}{k_0} =\sin\theta_i - \sin\theta_f &= \ell \frac{\delta k}{k_0} = \ell\frac{\lambda}{d}, & {\rm with} && \delta k &= \frac{2\pi}{d}.
\end{align}
And that is it.

\subsection{Sensitivity}

Any possible utility of this device rests on the observable change in angle resulting from a change in wavelength.  We will consider a detection approach where we place a lens of focal length $f$ a distance $f$ away from the grating and measure the spatial displacement of a specific order in response to the change in wavelength.

Linearizing around very small fractional wavelength changes we have
\begin{align}
\frac{d x}{d \lambda} &= -\frac{\ell f}{d\cos\theta_f} = -\frac{\ell f}{d}\left[1-\left(\sin\theta_i+\frac{\ell \lambda}{d}\right)^2\right]^{-1/2}
\end{align}

\begin{acknowledgments}
This work was partially supported by ...
\end{acknowledgments}

\bibliographystyle{apsrev4-1}
% \bibliography{StripePhase}

\end{document}


\par
\section{Data Structure}
\label{section:DSTree:dataStructure}
\par
The {\tt DSTree} object has a very simple data structure.
It contains a {\tt Tree} object to represent the tree fields
of the domains and separators, and an {\tt IV} object to hold the
map from the vertices to the domains and separators.
\begin{itemize}
\item {\tt Tree *tree} :  pointer to the {\tt Tree} object
\item {\tt IV *mapIV} : pointer to the {\tt IV} object that holds
the map from vertices to domains and separators.
\end{itemize}
% \begin{center}
% \begin{tabular}{|l|l|}
% \hline
% {\tt tree}  & pointer to the {\tt Tree} object \\
% {\tt mapIV} & pointer to the {\tt IV} object that holds \\
%             & the map from vertices to domains and separators. \\
% \hline
% \end{tabular}
% \end{center}


\section{Discussion}

A fundamental objective of evolutionary biology is the evaluation of the distribution of genetic variation among populations in geographic space. During the last few years, high-throughput sequencing technologies have allowed population geneticists to make fast progress in this direction. The access to extensive data have opened the door to a deeper understanding of the spatial distribution of adaptive and nonadaptive genetic variation in model and non-model organisms~\citep{manel2010perspectives}. This transition from population genetics to population and ecological genomics is accompanied by a revolution of the principles and methods used to analyze the influence of landscape features on genetic variation. This revolution is made possible thanks to the availability of fast computing programs than can deal with high dimension and heterogeneity in the data.

 By combining machine learning and spatial statistical methods, the computer program {\tt TESS3} enabled fast analysis of geographic and genome-wide patterns of genetic variation from large genomic data sets. In coalescent simulations of individuals with known ancestry, {\tt TESS3} produced accurate estimates of ancestry coefficients and ancestral allele frequencies. {\tt TESS3} results were statistically similar to those obtained with the Bayesian clustering program {\tt TESS} 2.3, but {\tt TESS3} was about 30 times faster than {\tt TESS} 2.3 when used with $K = 5$ ancestral populations and 50k binary loci. Though Bayesian approaches might be preferable for genotypic matrices of moderate dimensions, {\tt TESS3} generally outperformed {\tt TESS} 2.3 when more than a few thousands of markers were used.

A novelty of {\tt TESS3} is the identification of outlier loci from the genotypic matrix. Based on the estimations of the ancestral allele frequency matrix, the {\tt TESS3} algorithm computes a population differentiation statistic estimating a fixation index for each locus. If local adaptation favours a particular allele in some ancestral populations, the population differentiation statistic  at that locus will be larger than at loci which are selectively neutral. Outliers in the distribution of the population differentiation statistic are usually considered as loci potentially targeted by local selection~\citep{holsinger2009genetics}. The program output allows population geneticists to determine candidate loci based on FDR control algorithms, as for example implemented in the  {\tt R} package {\tt LEA}~\citep{frichot2015lea}.

The study of European lines of {\it A. thaliana} illustrated the main step of analysis using {\tt TESS3}. These steps can be summarized as follows: 1) Identifying the number of clusters using the cross-validation criterion, by launching multiple runs of the program for each value of $K$, 2) Displaying maps of ancestry coefficients using {\tt R} scripts provided with {\tt TESS} 2.3 or {\tt POPS}~\citep{jay2012forecasting}, 3) Performing a genome scan for selection based on ancestral allele frequency differentiation statistics. Results for {\it A. thaliana} suggested that clinal variation occurs along an east-west gradient separating two ancestral populations in Central Europe. Those results were in very good agreement with previous findings using {\tt TESS} 2.3, although these findings were obtained with a different data set~\citep{franccois2008demographic}. The genome scan for selection revealed contrasted patterns  among European lines of {\it A. thaliana} and provided evidence of a substantial role for selection in shaping the genome-wide variation of the species in Europe.

To conclude,  the computer program {\tt TESS3} provides a major update of the {\tt TESS} program  enabling rapid ancestry coefficient estimation and genome scans for adaptive alleles. While preserving the accuracy of {\tt TESS} 2.3, the least-squares algorithms of {\tt TESS3} ran substantially faster than the Bayesian algorithms of {\tt TESS} when analyzing large population genomic data sets.

\paragraph{Installing {\tt TESS3}.} Source codes, installation files and program documentation are available from the following link:

{\tt https://github.com/cayek/TESS3}

\section*{Acknowledgments}
This work was supported by a grant from the Laboratoire d\rq{}Excellence Labex Persyval-lab to Kevin Caye and Olivier Fran\c{c}ois. Olivier Fran\c{c}ois acknowledges support from Grenoble INP, and from the ``Agence Nationale de la Recherche\rq\rq{} (project AFRICROP ANR-13-BSV7-0017).

\section*{Data Accessibility} The Atwell et al. (2010) data used in this study are publicly available from the following link:\par
 {\tt https://github.com/Gregor-Mendel-Institute/atpolydb}


\subsection{Spin-statistics theorem}

\subsection{Heisenberg's uncertainty principle}

Result of spin-statistics theorem?


\vssub
\subsection{~Spatial and temporal tracking of wave systems} \label{sub:num_track}
\conthead{IFP Swan}{Van der Westhuysen, Hanson, Devaliere}

\noindent
The spectral partitioning procedure described above is carried out within the
spectral space, independently at each geographical grid point. As a result,
there is no coherence between the identified partitions over geographical
space and in time. Following \cite{art:VMH97}, \cite{art:HP01} and
\cite{pro:DHL09}, a spatial correlation step is therefore applied.  This is
done by means of an outwardly running spiral, originating at an arbitrary
point (typically the center) inside the computational domain.
Figure~\ref{fig:wavetrack} presents an example of such a tracking spiral on a
regular computational grid over a coastal domain featuring landmass. At the
spiral origin (location~1), each spectral partition is assigned an initial
system index. The spatial correlation is then determined for each subsequent
geographical location (2, 3, 4, ...) moving outward along the spiral.  At each
new geographical location, the peak period $T_\mathrm{p}$, peak direction
$\theta_\mathrm{p}$ and significant wave height $H_\mathrm{m0}$ of each of its
spectral partitions are correlated with the spatial means
$\tilde{T}^\mathrm{n}_{\mathrm{p},i}$,
$\tilde{\theta}^\mathrm{n}_{\mathrm{p},i}$ and
$\tilde{H}^\mathrm{n}_{\mathrm{m0},i}$ of the corresponding parameters at its
neighboring geographical grid points (indicated by the superscript
$\mathrm{n}$) previously assigned a system $i$. the partition at the present
grid point is assigned to the neighboring system $i$ that minimizes the
following Goodness-of-Fit (GoF) function:

\begin{figure} \begin{center}
\epsfig{file=./num/wavetrack.eps,width=3.5in}
\caption{Example of a tracking spiral on a regular computational grid
over a coastal domain featuring landmass (shaded). Black dots indicate
active grid points and white dots indicate inactive (dry) grid points.}
         \label{fig:wavetrack} \botline
\end{center}
\end{figure}

\begin{equation}
    GoF_{i} = {\left( \frac{T_\mathrm{p} - \tilde{T}^\mathrm{n}_{\mathrm{p},i}}{\Delta T_\mathrm{n}} \right)}^2 +
                     {\left( \frac{\theta_\mathrm{p} - \tilde{\theta}^\mathrm{n}_{\mathrm{p},i}}{\Delta\theta_\mathrm{n}} \right)}^2 +
                     {\left( \frac{H_\mathrm{m0} - \tilde{H}^\mathrm{n}_{\mathrm{m0},i}}{\Delta H_\mathrm{n}} \right)}^2\ \ ,
\label{eq:grdgof}
\end{equation}

\noindent
where $\Delta T_\mathrm{n}$, $\Delta\theta_\mathrm{n}$ and $\Delta
H_\mathrm{n}$ are combining criteria \citep{art:WHD13}. If either of the first
two terms on the right hand side of (\ref{eq:grdgof}) exceed unity for the
closest match, the difference is considered too great and a new wave system is
assigned to that partition. Here, the search range for neighboring points is
set at 1, so that a maximum of four previously-associated neighbors can be
found (e.g. location 15 will have the previously processed neighbors 3, 4, 5
and 14). In some cases, iterative combining is required.

The next step is to correlate these wave systems over time. Each system $i$ at
the current time level $t$ is associated with its closest match amongst the
systems $j$ at the previous time level $(t-1)$. Three characteristics of the
wave systems are considered in this process, namely: (i) the spatial mean peak
wave period over the system, $\tilde{T}^\mathrm{s}_{\mathrm{p},t,i}$, with
$\mathrm{s}$ denoting the system mean, (ii) the spatial mean peak wave
direction, $\tilde{\theta}^\mathrm{s}_{\mathrm{p},t,i}$ and (iii) the number
of overlapping grid points between the two systems in geographical space
$\cap_{i,j}$. These characteristics are combined to form the following
GoF function:

\begin{equation}
    GoF_{i,j} = {\left( \frac{\tilde{T}^\mathrm{s}_{\mathrm{p},t,i} - \tilde{T}^\mathrm{s}_{\mathrm{p},t-1,j}}{\Delta T_\mathrm{s}} \right)}^2 +
                       {\left( \frac{\tilde{\theta}^\mathrm{s}_{\mathrm{p},t,i} - \tilde{\theta}^\mathrm{s}_{\mathrm{p},t-1,j}}{\Delta\theta_\mathrm{s}} \right)}^2 +
                       {\left( \frac{N_{t-1,j} - \cap_{i,j}}{0.5N_{t-1,j}} \right)}^2\ \ ,
\label{eq:timegof}
\end{equation}

\noindent
where $\Delta T_\mathrm{s}$ and $\Delta\theta_\mathrm{s}$ are combining
criteria, and $N$ is the total number of grid points in a system, see
\cite{art:WHD13}. In order to focus the tracking process on high-energy
regions in the wave field, the spatial mean period and peak direction values
of each system are weighted with the square of the significant wave
height. System $i$ at the current time level $t$ is assigned the system $j$
from the previous time level $(t-1)$ that minimizes (\ref{eq:timegof}). If any
of the three terms on the right hand side of (\ref{eq:timegof}) exceed unity
for the system that minimizes (\ref{eq:timegof}), a new system number is
assigned. For the last term, this implies a minimum spatial overlap
requirement, arbitrarily set at 50\%. This term mostly has an impact over
basin scale domains, where systems are typically smaller than the
computational area. In order to improve robustness, the details of identified
systems are stored for five time levels, after which the system association is
released.


\section{Body parts}
In the World of Artograch RPG, each and every \textbf{body part} has its own health meter. When that health meter is depleted, bad things can happen: if we're talking about a limb, the character is imparted with a negative status effect and certain equipment slots are bound to be disabled \textemdash if the body part in question is not a limb, then the depletion of its health points causes death \textit{(or unconsciousness, if house rules rule out death)}, as the vital body part in question is assumed to be destroyed.\newline
The exact number of body parts a character can have depends on their race, though most humanoid races have one head, one torso, two arms and two legs, out of which the head and the torso are vital, with depletion of its hitpoints causing death - while loss of arms and legs merely disables the corresponding inventory slots.\newline
The fact that each body part has its own health meter is one of the reasons why the World of Artograch roleplaying system is not recommended for actual tabletop roleplaying \textit{(in spite of technically being possible)}, but rather is intended to serve as the basis of computer-based adaptations.\newline
As most humanoid races have a single torso, a single head, two arms and two legs, below will be shown the health scaling for those body parts:\newline
\begin{tabular}{|c|c|c|c|c|c|}
\hline
\textbf{Torso} & \textbf{Head} & \textbf{Left Arm} & \textbf{Right Arm} & \textbf{Left Leg} & \textbf{Right Leg} \\ \hline
$\frac{\textit{Base HP\ast}}{1} $ & $ \frac{\textit{Base HP\ast}}{4} $ & $ \frac{\textit{Base HP\ast}}{5} $ & $ \frac{\textit{Base HP\ast}}{5} $ & $ \frac{\textit{Base HP\ast}}{2} $ & $ \frac{\textit{Base HP\ast}}{2} $ \\ \hline
\end{tabular}\newline
$ \textbf{\ast Base HP} $ is the character's $ \textbf{Endurance} \cdot 10 $, unless there are some other modifiers at play, such as status effects or feats. In other words, without any other modifiers, a typical humanoid character with an Endurance of 10 will have a torso with $ \frac{10 \cdot 10}{1} = 100 $ HP, a head with $ \frac{10 \cdot 10}{4} = 25 $ HP, a right arm and a left arm each with $ \frac{10 \cdot 10}{5} = 20 $ HP, and finally a right leg and a left lef each with $ \frac{10 \cdot 10}{2} = 50 $ HP.\newline
Chances to hit a certain body part also scale with the amount of maximum HP each body part can potentially have: if we add together 100, 25, 20, 20, 50 and 50, we get 265, which results in ratios of $ \frac{100}{265}=37.73\% $, $ \frac{25}{265}=9.43\% $, $ \frac{20}{265}=7.55\% $, $ \frac{20}{265}=7.55\% $, $ \frac{50}{265}=18.88\% $ and $ \frac{50}{265}=18.88\% $ respectively. But what does that exactly mean? It means that if the character simply attacks the enemy without targetting any particular body part, we generate a random number between 0 and 100, and then, if the number is is above 81, it is the right leg - if it's below that, but still above 62, it's the left leg, right arm if below that but above 55, left arm if below that but above 47, head if below that but above 38, and torso if below 38 - alternatively, in a more simplifeid dice-rolling system, one most use two 10-sided dice or four 5-sided dice, and the numbers are instead 16, 12, 11, 9, 8.\newline
If the attacker is attacking from a mount, the legs cannot be targeted and will never be hit, which means that the numbers should instead be $ \frac{100}{165}=60.60\% $, $ \frac{25}{165}=15.15\% $, $ \frac{20}{165}=12.12\% $, $ \frac{20}{165}=12.12\% $ - that is, above 88 for right hand, below that but above 76 for left hand, below that but above 61 for head, and below 61 for torso; with the numbers instead being 18, 15 and 12 for dice-rolling.


\chapter{Auto-Regressive processes, Moving-Average processes and Wold's theorem}


\chapter{Parameterized Guarded Systems} \label{chap:guarded-systems}
\hfill {\footnotesize\textit{This chapter is based on joint work with S.Au{\ss}erlechner and S.Jacobs~\cite{AJK16,SimonThesis}~~~~~~~~}}

\begin{quotation}
\noindent\textbf{Abstract.}
Guarded protocols were introduced in a seminal
paper by Emerson and Kahlon (2000), and describe systems of processes whose transitions
are enabled or disabled depending on the existence of other processes in
certain local states.
In this chapter we study parameterized model checking and synthesis of
guarded protocols, both aiming at formal correctness arguments for systems with any number of processes.
Cutoff results reduce reasoning about systems with an arbitrary
number of processes to systems of a determined, fixed size. Our work stems
from the observation that existing cutoff results for guarded protocols
(i) are restricted to closed systems, and
(ii) are of limited use for liveness properties because reductions do not preserve fairness.
We close these gaps and obtain new cutoff results for open systems with liveness properties under
fairness assumptions.
Furthermore, we obtain cutoffs for the detection of global and local deadlocks,
which are of paramount importance in synthesis.
Finally, we prove tightness or asymptotic tightness for the new cutoffs.
\end{quotation}

\input{guarded-systems/macros}
\input{guarded-systems/intro}
\input{guarded-systems/related}
\input{guarded-systems/prelim}
\input{guarded-systems/reduction-cutoff}
\input{guarded-systems/cutoffs}
\input{guarded-systems/proof-structure}
\input{guarded-systems/proofs-disj}
\input{guarded-systems/proofs-conj}
%\input{guarded-systems/experiments}
\input{guarded-systems/conclusion}