TITLE: Prove that among any five consecutive positive integers there is one integer which is relatively prime to the other four integers.
QUESTION [1 upvotes]: Two integers are called relatively prime if the greatest common divisor of $m$ and $n$ is $1$. Prove that among any five consecutive positive integers there is one integer which is relatively prime to the other four integers. (Hint: For any two positive integers $m < n$, any common divisor has to be less than or equal to $n - m$).

The question has already been asked before here, but I do not understand the steps. Is there a simpler approach? Or can anyone explain any of the answers provided in the linked question in details?
The problem is I'm not comfortable with Pigeon-hole principle or GCD (and divisibility) or modular arithmetic. Assume I do not know any of these.

REPLY [1 votes]: If two number differ by $1$, they are relatively prime.  If they differ by $2$, their greatest common divisor is either $1$ or $2$.  And if they differ by $3$, their greatest common divisor is either $1$ or $3$.  Therefore, given five consecutive numbers:
If the middle number is odd, then it is relatively prime to the two adjacent numbers on each side of it.
If the middle number is even, then at least one of the two odd numbers adjacent to it is not divisible by $3$.  That odd number (or either of them, if neither is divisible by $3$) is relatively prime to the other four numbers.

REPLY [1 votes]: Let the numbers be $$n-2, n-1, n, n+1, n+2$$
Case I: $n$ is odd , then $n$ is prime to all the $4$ other integers, as is easy to see.
Case II, $n-1$ and $n+1$ are odd. $n-1$ is prime to all except maybe $n+2$, both of which may be divisible by $3$. Similarly $n+1$ is prime to the others
except maybe $n-2$, both of which may be divisible by $3$. However not all of these numbers can be divisible by $3$ so one of $n-1$ or $n+1$ will satisfy the requirements.


TITLE: Real Analysis. Differentiation (Taylor's Formula). Check proof.
QUESTION [1 upvotes]: Show that the polynomial
  $$x - \frac{x^3}{3!} + \frac{x^5}{5!} - ... \pm \frac{x^n}{n!},$$
  with $n$ odd, differs from $\sin x$ by, at most, $\frac{\pi^{n+1}}{(n+1)!}$ in $[-\pi, \pi]$.

$\textbf{Solution:}$ Applying the Taylor's Formula in $f(x) = \sin x$ for $x_{0} = 0$:
$$\sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - ... \pm \frac{x^n}{n!} + R_{n+1}$$
and
$$R_{n+1} = \frac{f^{(n+1)}(c)}{(n+1)!}x^{n+1}$$
for $c \in (0,x)$. Since $|f^{(n+1)}(c)| \leq 1$ and $|x|^{n+1} \leq \pi^{n+1}$
$$R_{n+1} = \frac{f^{(n+1)}(c)}{(n+1)!}x^{n+1} \leq \frac{\pi^{n+1}}{(n+1)!}.$$
The result follows.
Is this correct?

REPLY [1 votes]: Yes, your proof is correct.
I would change $$ R_{n+1} = \frac{f^{(n+1)}(c)}{(n+1)!}x^{n+1} \leq \frac{\pi^{n+1}}{(n+1)!}.$$
to $$ |R_{n+1}| = \frac{|f^{(n+1)}(c)|}{(n+1)!}x^{n+1} \leq \frac{\pi^{n+1}}{(n+1)!}.$$


text:
\begin{abstract}
	We present simple differentially private estimators for the mean and covariance of multivariate sub-Gaussian data that are accurate at small sample sizes.  We demonstrate the effectiveness of our algorithms both theoretically and empirically using synthetic and real-world datasets---showing that their asymptotic error rates match the state-of-the-art theoretical bounds, and that they concretely outperform all previous methods. Specifically, previous estimators either have weak empirical accuracy at small sample sizes, perform poorly for multivariate data, or require the user to provide strong a priori estimates for the parameters.
\end{abstract}

\section{Introduction}
	One of the most basic problems in statistics and machine learning is to estimate the mean and covariance of a distribution based on i.i.d.\ samples.  Not only are these some of the most basic summary statistics one could want for a real-valued distribution, but they are also building blocks for more sophisticated statistical estimation tasks like linear regression and stochastic convex optimization.

	The optimal solutions to these problems are folklore---simply output the empirical mean and covariance of the samples.  However, this solution is not suitable when the samples consist of sensitive, private information belonging to individuals, as it has been shown repeatedly that even releasing just the empirical mean can reveal this sensitive information~\cite{DinurN03,HomerSRDTMPSNC08,BunUV14,DworkSSUV15,DworkSSU17}.  Thus, we need estimators that are not only accurate with respect to the underlying distribution, but also protect the \emph{privacy} of the individuals represented in the sample.

 	The most widely accepted solution to individual privacy in statistics and machine learning is \emph{differential privacy} (DP)~\cite{DworkMNS06}, which provides a strong guarantee of individual privacy by ensuring that no individual has a significant influence on the learned parameters. A large body of work now shows that, in principle, nearly every statistical task can be solved privately, and differential privacy is now being deployed by Apple~\cite{AppleDP17}, Google~\cite{ErlingssonPK14,BittauEMMRLRKTS17}, Microsoft~\cite{DingKY17}, and the US Census Bureau~\cite{DajaniLSKRMGDGKKLSSVA17}.

	Differential privacy requires adding random noise to some stage of the estimation procedure, and this noise might increase the error of the final estimate.  Typically, the amount of noise vanishes as the sample size $n$ grows, and one can often show that as $n \to \infty$, the additional error due to privacy vanishes faster than the sampling error of the estimator, making differential privacy highly practical for large samples.

  However, differential privacy is often difficult to achieve for small datasets, or when the dataset is large, but we want to restrict attention to some small subpopulation within the data.  Thus, a recent trend has been to focus on simple, widely used estimation tasks, and design estimators with good concrete performance at small samples sizes.  Most relevant to our work, Karwa and Vadhan \cite{KarwaV18} and Du, Foot, Moniot, Bray, and Groce~\cite{DuFMBG20} give practical mean and variance estimators for univariate Gaussian data. However, as we show, these methods do not scale well to the more challenging multivariate setting.

\subsection{Contributions}
	In this work we give simple, practical estimators for the mean and covariance of \emph{multivariate} sub-Gaussian data.  We call our method \textsc{CoinPress}, for COnfidence-INterval-based PRivate EStimation Strategy.
	We validate our estimators theoretically and empirically.  On the theoretical side, we show that our estimators match the state-of-the-art asymptotic bounds for sub-Gaussian mean and covariance estimation~\cite{KamathLSU19}.  On the empirical side, we give an extensive evaluation with synthetic data, as well as a demonstration on a real-world dataset.  We show that our estimators have error comparable to that of the non-private empirical mean and covariance at small sample sizes.  See Figure~\ref{fig:intro-1} for one representative example of our algorithm's performance.  Our mean estimator also improves over the state-of-the-art method of Du et al.~\cite{DuFMBG20}, which was developed for univariate data but can be applied coordinate-wise to estimate multivariate data.  We highlight a few other important features of our methods:

	\begin{figure}[t]
		\centering
		\resizebox{0.45\textwidth}{!}{\includegraphics{figures/intro-mean.png}}
		\resizebox{0.45\textwidth}{!}{\includegraphics{figures/intro-cov.png}}
		\caption{The cost of privacy, measured as the ratio of our iterative estimator's error to that of the non-private estimator.  For mean estimation (left) we use $d = 50$ and privacy level $\rho = 0.5$ and vary $n \in (300,5000)$.  For covariance estimation (right) we use $d = 10$ privacy level $\rho = 0.5$ and vary $n \in (2000,10000)$.}
		\label{fig:intro-1}
	\end{figure}

	First, like many differentially private estimators, our method requires the user to input some a priori knowledge of the data.  For mean estimation, we require the mean lives in a specified ball of radius $R$, and for covariance estimation we require that the covariance matrix can be sandwiched spectrally between $A$ and $K A$ for some matrix $A$.  Some a priori boundedness is \emph{necessary} for algorithms like ours that satisfy concentrated DP~\cite{DworkR16,BunS16,Mironov17,BunDRS18}, or satisfy pure DP.\footnote{Under pure or concentrated DP, the dependence on $R$ and $K$ must be polylogarithmic~\cite{KarwaV18,BunKSW19}. One can allow $R = \infty$ for mean estimation under $(\eps,\delta)$-DP with $\delta > 0$~\cite{KarwaV18}, although the resulting algorithm has poor concrete performance even for univariate data.  It is an open question whether one can allow $K = \infty$ for covariance estimation even under $(\eps,\delta)$-DP.}
	We show that our estimator is practical when these parameters are taken to be extremely large, meaning the user only needs a very weak prior.

	Second, for simplicity, we describe and evaluate our methods primarily with Gaussian data.  However, the only feature of Gaussian data that is relevant for our methods is a strong bound on the tails of the distribution, and, by definition, these bounds hold for any sub-Gaussian distribution.  Moreover, using experiments with both heavier-tailed synthetic data and with real-world data, we demonstrate that our method remains useful even when the data is not truly Gaussian.  Note that some restriction on the details of the data is necessary, at least in the worst-case, as~\cite{KamathSU20} showed that the minimax optimal error is highly sensitive to the rate of decay of the distribution's tails.

  \begin{wrapfigure}[19]{r}{0.4\textwidth}
	\includegraphics[scale=0.5]{figures/one-run.png}
	\vspace{-10pt}
	\caption{Visualizing a run of the mean estimator with $n = 160, \rho = 0.1, t = 3$.  The data is represented by the blue dots, the black circles represent the iteratively shrinking confidence ball, and the orange dot is the final private mean estimate.}
\end{wrapfigure}
  \medskip\noindent\textbf{Approach.}
  At a high-level, our estimators work by iteratively refining an estimate for the parameters, inspired by~\cite{KamathLSU19}.  For mean estimation, we start with some (potentially very large) ball $B_1$ of radius $R_1$ that we know contains most of the mass of the probability distribution.  We then use this ball to run a na\"ive estimation procedure: clip the data to the ball $B_1$, then add noise to the empirical mean of the clipped data to obtain some initial estimate  of the mean.  Specifically, the noise will have magnitude proportional to $R_1 / n$.  Using this estimate, and knowledge of how we obtainesd it, we can draw a (hopefully significantly smaller) ball $B_2$ of radius $R_2$ that contains most of the mass and then repeat.  After a few iterations, we will have some ball $B_t$ of radius $R_t$ that tightly contains most of the datapoints, and use this to make an accurate final private estimate of the meanwith noise proportional to $R_t / n$.  Our covariance estimation uses the same iterative approach, although the geometry is significantly more subtle.

\subsection{Problem Formulation}
\label{sec:problem-formulation}
	We now give a more detailed description of the problem we consider in this work.  We are given an ordered set of samples $X = (X_1,\dots,X_n) \subseteq \R^d$ where each $X_i$ represents some individual's sensitive data.  We would like an estimator $M(X)$ that is \emph{private} for the individuals in the sample, and also \emph{accurate} in that when $X$ consists of i.i.d.\ samples from some distribution $P$, then $M(X)$ estimates the mean and covariance of $P$ with small error.  Notice that privacy will be a \emph{worst-case} property, making no distributional assumptions, whereas accuracy will be formulated as an \emph{average-case} property relying on distributional assumptions.

	For privacy, we require that $M$ is insensitive to any one sample in $X$ in the following sense:  We say that two samples $X,X' \subseteq \R^d$ of size $n$ are \emph{neighboring} if they differ on at most one sample.\footnote{For simplicy, we use the common convention that the size of the sample $n$ is fixed.}  Informally, we say that a randomized algorithm $M$ is \emph{differentially private}~\cite{DworkMNS06} if the distributions $M(X)$ and $M(X')$ are similar for every pair of neighboring datasets $X,X'$.  In this work, we adopt the quantiative formulation of differential privacy called \emph{concentrated differential privacy (zCDP)}~\cite{DworkR16,BunS16}.
	\begin{definition}[zCDP] An estimator $M(X)$ satisfies $\rho$-zCDP if for every pair of neighboring samples $X,X'$ of size $n$, and every $\alpha \in (1,\infty)$, $D_{\alpha}(M(X) \| M(X')) \leq \rho \alpha$, where $D_{\alpha}$ is the R\'{e}nyi divergence of order $\alpha$.
	\end{definition}
	This formulation sits in between general $(\eps,\delta)$-differential privacy and the special case of $(\eps,0)$-differential privacy,\footnote{Formally, $(\eps,0)$-DP $\Longrightarrow$ $\frac{1}{2}\eps^2$-zCDP $\Longrightarrow$ $(\eps \sqrt{2 \log(1/\delta)} + \frac{1}{2} \eps^2, \delta)$-DP for every $\delta > 0$} and better captures the privacy cost of private algorithms in high dimension~\cite{DworkSSU17}.

	To formulate the accuracy of our mechanism, we posit that $X$ is sampled i.i.d.\ from some distribution $P$, and our goal is to estimate the mean $\mu \in \R^d$ and covariance $\Sigma \in \R^{d \times d}$ with
	$$
	\mu = \ex{x \sim P}{x} \quad \textrm{and} \quad \Sigma = \ex{x \sim P}{(x - \mu)^T(x - \mu)}.
	$$
  	We assume that our algorithms are given some a priori estimate of the mean in the form of a radius $R$ such that $\| \mu \|_2 \leq R$ and some a priori estimate of the covariance in the form of $K$ such that $\id \preceq \Sigma \preceq K \id$, (equivalently all the singular values of $\Sigma$ lie between $1$ and $K$). We repeat that some a priori bound on $R,K$ is \emph{necessary} for any algorithm that satisfies zCDP~\cite{BunS16,KarwaV18}.

  	We measure the error in \emph{Mahalanobis} distance $\| \cdot \|_{\Sigma}$, which reports how the error compares to the covariance of the distribution, and has the benefit of being invariant under affine transformations.  Specifically,
	\[
	\| \hat\mu - \mu \|_\Sigma = \| \Sigma^{-1/2}(\hat\mu - \mu)\|_2 \quad \textrm{and} \quad \| \hat\Sigma - \Sigma \|_{\Sigma} = \| \Sigma^{-1/2} \hat\Sigma \Sigma^{-1/2} - \id \|_F.
	\]
	For any distribution, the \emph{empirical mean} $\hat\mu$ and \emph{empirical covariance} $\hat\Sigma$ satisfy
	\[
	\ex{}{	\| \hat\mu - \mu \|_\Sigma } \leq \sqrt{\frac{d}{n}} \quad \textrm{and} \quad \ex{}{ \| \hat\Sigma - \Sigma \|_\Sigma} \leq \sqrt{\frac{d^2}{n}},
	\]
  and these estimators are minimax optimal. Our goal is to obtain estimators that have similar accuracy to the empirical mean and covariance.  We note that the folklore na\"ive estimators (see e.g.~\cite{KarwaV18, KamathLSU19}) for mean and covariance based on clipping the data to an appropriate ball and adding carefully calibrated noise to the empirical mean and covariance would guarantee
	\[
	\ex{}{	\| \hat\mu - \mu \|_\Sigma } \leq \sqrt{\frac{d}{n} + \frac{R^2 d^2}{n^2 \rho}} \quad \textrm{and} \quad \ex{}{ \| \hat\Sigma - \Sigma \|_\Sigma } \leq \sqrt{\frac{d^2}{n} + \frac{K^2 d^4}{n^2 \rho}}.
	\]
	The main downside of the na\"ive estimators is their error increases rapidly with $R$ and $K$, and thus introduce large error unless the user has strong a priori knowledge of the mean and covariance.  Requiring users to provide such a priori bounds is a major challenge in deployed systems for differentially private analysis (e.g.~\cite{GaboardiHKMNUV16}).  Our estimators have much better dependence on these parameters, both asymptotically and concretely.

	For our theoretical analysis and most of our evaluation, we derive bounds on the error of our estimators assuming $P$ is specifically the Gaussian $N(\mu,\Sigma)$.  Although, as we show in some of our experiments, our methods perform well even when we relax this assumption.

\subsection{Related Work}
The most relevant line of work is that initiated by Karwa and Vadhan~\cite{KarwaV18}, which studies private mean and variance estimation for Gaussian data, and focuses on important issues for practice like dealing with weak a priori bounds on the parameters.  Later works studied the multivariate setting~\cite{KamathLSU19, CaiWZ19, KamathSSU19} and estimation under weaker moment assumptions~\cite{BunS19,KamathSU20}, though these investigations are primarily theoretical.
Our algorithm for covariance estimation can be seen as a simpler and more practical variant of~\cite{KamathLSU19}.
They provide an iterative procedure which, based on a privatized  finds the subspaces of high and low variance
 they iteratively threshold eigenvalues to find directions of high and low variance, whereas we employ a softer method to avoid wasting information.
One noteworthy work is~\cite{DuFMBG20}, which provides practical private confidence intervals in the univariate setting.  Instead, our investigation is focused on realizable algorithms for the multivariate setting.  Several works consider private PCA or covariance estimation~\cite{DworkTTZ14,HardtP14,AminDKMV19}, though, unlike our work, these methods assume strong a priori bounds on the covariance.

A number of the early works in differential privacy give methods for differentially private statistical estimation for i.i.d.\ data.
The earliest works~\cite{DinurN03,DworkN04,BlumDMN05,DworkMNS06}, which introduced the Gaussian mechanism, among other foundational results, can be thought of as methods for estimating the mean of a distribution over the hypercube $\{0,1\}^d$ in the $\ell_\infty$ norm.
Tight lower bounds for this problem follow from the tracing attacks introduced in~\cite{BunUV14,SteinkeU17a,DworkSSUV15,BunSU17,SteinkeU17b}.
A very recent work of Acharya, Sun, and Zhang~\cite{AcharyaSZ20} adapts classical tools for proving estimation and testing lower bounds (the lemmata of Assouad, Fano, and Le Cam) to the private setting.
Steinke and Ullman~\cite{SteinkeU17b} give tight minimax lower bounds for the weaker guarantee of selecting the largest coordinates of the mean, which were refined by Cai, Wang, and Zhang~\cite{CaiWZ19} to give lower bounds for sparse mean-estimation.

Other approaches for Gaussian estimation include~\cite{NissimRS07}, which introduced the sample-and-aggregate paradigm, and~\cite{BunKSW19} which employs a private hypothesis selection method.
Zhang, Kamath, Kulkarni, and Wu privately estimate Markov Random Fields~\cite{ZhangKKW20}, a generalization of product distributions over the hypercube.
Dwork and Lei~\cite{DworkL09} introduced the propose-test-release framework for estimating robust statistics such as the median and interquartile range.
For further coverage of private statistics, see~\cite{KamathU20}.

config: arxiv


text:
\begin{document}
\title{Energy-Efficient Cooperative Cognitive Relaying Protocols for Full-Duplex Cognitive Radio Users and Delay-Aware Primary Users}
\author{Ahmed~El~Shafie,~\IEEEmembership{Member,~IEEE,}
        Tamer~Khattab,~\IEEEmembership{Member,~IEEE,}\\
        Amr El-Keyi,~\IEEEmembership{Member,~IEEE,}
        ~and H. Vincent Poor,~\IEEEmembership{Fellow,~IEEE}
\thanks{A. El Shafie is with Wireless Intelligent Networks Center (WINC), Nile University, Giza, Egypt. He is also with Electrical Engineering, Qatar University, Doha, Qatar (e-mail: ahmed.salahelshafie@gmail.com).}
\thanks{T. Khattab is with Electrical Engineering, Qatar University, Doha, Qatar (email: tkhatta@ieee.org).}
\thanks{A. El-Keyi is with Wireless Intelligent Networks Center (WINC), Nile University, Giza, Egypt (aelkeyi@nileuniversity.edu.eg).}
\thanks{H. V. Poor
is with the Department of Electrical Engineering, Princeton University, Princeton, NJ 08544 USA (email:
poor@princeton.edu).}
\thanks{This research work is supported by Qatar National Research Fund (QNRF) under grant number NPRP 09-1168-2-455.}}
\date{}
\maketitle
\begin{abstract}
This paper considers a network in which a primary user (PU) may cooperate with a cognitive radio
(CR) user for transmission of its data packets. The PU is assumed to be a buffered terminal operating in a time-slotted fashion. We develop two protocols which involve cooperation between primary and secondary users. To satisfy certain quality of service requirements, users share time slot duration and frequency bandwidth. Moreover, the secondary user (SU) may leverage the primary feedback signal. The proposed protocols are designed such that the secondary rate is maximized and the primary queueing delay is maintained less than the queueing delay in case of non-cooperative PU. In addition, the proposed protocols guarantee the stability of the primary queue and maintain the average energy emitted by the CR user below a certain value. The proposed protocols also provide more robust and potentially continuous service
for SUs compared to the conventional practice in cognitive
networks where SUs transmit in the spectrum holes and silence sessions
of the PUs. We include primary source burstiness, sensing errors, and feedback reception errors to the analysis of the proposed cooperative cognitive protocols. Numerical results show the beneficial gains of the cooperative protocols in terms of secondary rate and primary throughput, queueing delay, and average energy savings.
\end{abstract}
\begin{IEEEkeywords}
Cognitive radio, rate, queue stability, optimization problems.
\end{IEEEkeywords}
\section{Introduction}
  \IEEEPARstart{S}\small{econdary} utilization of the licensed frequency bands can efficiently improve the spectral density of the underutilized licensed spectrum. Cognitive radio (CR) users are smart terminals that use cognitive technologies to adapt with variations, and exploit methodologies of learning and reasoning to
dynamically reconfigure their communication parameters.

Cooperative diversity is a recently emerging technique
for wireless communications that has gained wide interest. Recently, cooperative cognitive relaying, where the secondary user (SU) operates as a relay for the primary user (PU), has got extensive attention \cite{devroye2006achievable,simeone,simeone2008spectrum,krikidis2009cognitive,khattab,su2011active,erph,Sult1212:Cooperative,krikidis2012stability}.

In \cite{devroye2006achievable}, the authors show that, under the assumption
that CR users know perfectly the PU's data, maximum rate can be achieved by simultaneous
transmission of primary and secondary data over the same
frequency band. The secondary data are jointly encoded with PU data via dirty-paper coding techniques.
In \cite{simeone}, the SU relays the undelivered primary packets during the silence sessions of the PU. The SU aims at maximizing its throughput via adjusting its transmit power.

In \cite{krikidis2009cognitive}, Krikidis {\it et al.} proposed to deploy a {\it dumb} relay node in cognitive radio
networks to improve
network spectrum efficiency. The relay aids the primary and the secondary users. The proposed protocol is analyzed
and optimized for a network model consisting of a pair of PUs and a pair of SUs.
In \cite{khattab}, the authors considered a network with a single primary node and a single secondary node. The SU is allowed to access the channel when the PU's queue is empty. The secondary has a relaying queue to store a fraction of the undelivered primary packets controlled via an adjustable admittance factor. A priority of transmission is given to the relayed packets over the secondary packets. The SU aims at minimizing its queueing delay subject to a power
budget for the relayed primary packets. In \cite{erph}, the authors characterized fundamental issues for a shared channel composed of a PU and an SU. The authors considered a general multi-packet reception model, where concurrent packet transmission could be correctly decoded at receivers with certain probability. The PU has unconditional channel access, whereas the SU accesses the channel based on the state of the PU, i.e., active or inactive. The sensing algorithm is assumed to be perfect. The secondary terminal is assumed to be capable of relaying the undelivered primary packets. If the PU is sensed to be inactive, the SU accesses the channel with probability one, and if the PU is active, the SU randomly accesses the channel simultaneously with the PU or attempts to decode the primary packet with the complement probability. The maximum stable throughput of the network is obtained via optimizing over the access probability assigned by the SU during the active sessions of the PU.

Leasing portions of primary systems time slot duration and bandwidth for the SUs have been considered in several works, e.g., \cite{simeone2008spectrum,su2011active,elshafie}. In \cite{simeone2008spectrum}, the authors proposed a spectrum
leasing scheme in which PUs may
lease its owned bandwidth for a fraction of time to SUs based on decode-and-forward relaying
scheme and distributed space-time coding. In \cite{su2011active}, the authors proposed a new cooperative cognitive protocol, where the PU releases portion of its bandwidth to the SU. The SU utilizes an amplify-and-forward relaying scheme. It receives the primary data during the first half of the time slot, then forwards the amplified data during the second half of the time slot. El Shafie \emph{et al.} \cite{elshafie} considered an SU equipped with multi-antenna sharing the spectrum with a single antenna energy-aware PU, where the PU aims at maximizing its mean transmitted packets per joule. The users split the time slot duration and the total bandwidth to satisfy certain QoS for the PU that cannot be attained without cooperation. Both users maintain data buffers and are assumed to send one data packet per time slot.

In this paper, we develop two cooperative cognitive protocols which allow the SU to transmit its data bits simultaneously with the PU. Under the proposed protocols, the PU may cooperate with the SU to enhance its quality of service, i.e., to enhance its average queueing delay and maintain its queue stability. If cooperation is beneficial for the PU, it releases portion of its bandwidth and time slot duration for the SU. In turn, the SU incurs portion of its transmit energy to relay the primary packets. The SU employs decode-and-forward (DF) relaying technique. The time slot is divided into several intervals (or phases) that change according to the adopted protocol, as will be explained later. In the first proposed cooperative protocol, the SU {\it blindly} forwards what it receives from the PU even if the primary destination can decode the data packet correctly at the end of the primary transmission phase. On the other hand, in the second proposed protocol, the SU forwards what it receives from the PU if and only if the primary destination could not decode the primary transmission of the primary packet; or if the SU considers the feedback signal as a negative-acknowledgement from the primary destination.\footnote{In this paper, the primary feedback channel is assumed to be modeled as an erasure channel model and can be undecodable at the secondary terminal. This will be justified in Section \ref{protocol2x}.}

However, as will be explained later, there is a cost for using the second protocol which is a reduction in the time available for data transmission of users due to the presence of an additional feedback duration.

The contributions of this paper can be stated as follows: We design two cooperative cognitive protocols which involve cooperation between the PUs and the SUs. The two protocols differ in terms of time slot structure and primary feedback mechanism. We consider practical assumptions for the cognitive network. Precisely, we consider spectrum sensing errors and primary feedback reception errors at the secondary terminal. Unlike \cite{su2011active}, the primary source burstiness is taken into consideration. In addition, in contrast to \cite{su2011active} and \cite{elshafie}, sensing errors are taken into considerations.  Unlike the existing works, we consider a cost on the feedback process and study its impact on the transmitters' rates.
We consider two quality of service constraints for the PU. Specifically, we assume a constraint on the primary queueing delay and a constraint on the stability of the primary queue. Moreover, we consider a practical energy constraint on the SU average transmit energy. The optimization problems are stated under such constraints.

This paper is organized as follows: In the next Section, we introduce the system model adopted in this paper. In Section \ref{primaryqueue}, we analyze the primary queue and discuss primary queueing delay and stability. The first proposed Protocol is explained in Section \ref{protocol1x}. In Section \ref{protocol2x}, we describe the modified protocol. The Numerical Results are shown in Section \ref{numerical}. We finally conclude the paper in Section \ref{conc}.
\section{System Model}\label{sysmod}
We consider a simple configuration composed of orthogonal primary channels, where each channel is used by a PU. Each primary transmitter-receiver pair coexists with a secondary transmitter-receiver pair. For simplicity in presentation, we focus on one of those orthogonal channels.\footnote{As argued in \cite{su2011active}, the proposed cooperative cognitive protocol and theoretical development
presented in this paper can be generalized to cognitive radio networks with more
PUs and more SUs.} Each orthogonal channel is composed of one secondary transmitter `${\rm s}$', one primary transmitter `${\rm p}$', one secondary receiver `${\rm sd}$' and one primary receiver `${\rm pd}$'. The SU is equipped with two antennas; one antenna for data transmission and the other for data reception and channel sensing, whereas the PU is equipped with a single antenna. The PU maintains an infinite buffer for storing a fixed-length packets. It is assumed that the primary queue is modeled as Geo/Geo/1 queueing system. The
arrivals at the primary queue are independent and identically
distributed (i.i.d.) Bernoulli random variables from slot to slot with mean $\lambda_{\rm p}\in[0,1]$ packets per time slot. Thus, the probability of having an arrival at the primary queue in an arbitrary time slot is $\lambda_{\rm p}$.

 We assume an interference wireless channel model, where concurrent transmissions are assumed to be lost data if the received signal-to-noise-and-interference-ratio (SINR) is less than a predefined threshold, or equivalently the instantaneous channel gain is lower than a predefined value.\footnote{This will be discussed later in Appendix B.} In this paper, we propose a DF relaying technique, where the SU decodes and forwards the primary packet. The secondary terminal is assumed to be full duplex which means that it can receive and transmit at the same time.

 All nodes transmit with fixed power $P_\circ$ Watts/Hz. Note that the total transmit power changes based on the used bandwidth per transmission. Time is slotted and a slot has a duration of $T$ seconds. Channel gain between node ${\rm j}$ and node ${\rm k}$, denoted by $\zeta_{\rm j,k}$, is distributed according to a circularly symmetric Gaussian random variable, which is constant over one slot, but changes independently from slot to slot. The expected value of $|\zeta_{\rm j,k}|^2$ is $\sigma_{\rm j,k}$, where $|\cdot|$ denotes the magnitude of a complex argument. Each receiving signal is perturbed by a zero mean additive white Gaussian noise (AWGN) with power spectral density $\mathcal{N}_\circ$ Watts/Hz. The outage of a channel (link) occurs when the transmission rate exceeds the capacity of the channel. The outage probability between two nodes ${\rm j}$ and ${\rm k}$ without and with the presence of interference from the other nodes are denoted by $\mathbb{P}_{\rm j,k}$ and $\mathbb{P}^{(\mathcal{I})}_{\rm j,k}$, respectively. These probabilities are functions of the number of bits in
a data packet, the slot duration, the transmission bandwidth, the
transmit powers, and the average channel gains as detailed in
Appendices~A and B.

The PU accesses the channel at the beginning of the time slot whenever it has a packet to send. Without cooperation, the PU uses the time slot and bandwidth for its own data transmission, while the SU does not gain any channel access even if the PU's queue is empty. This is because in practice the SU may erroneously misdetect the primary activity and therefore it may cause harmful interruption on the primary operation, e.g., collisions and packets loss. In case of cooperation and based on the proposed cooperative cognitive protocols, the PU will release a fraction of its time slot duration and its bandwidth for the SU to be used for secondary operation. In practice, the secondary node may get permission to access the spectrum if it either provides economic incentives for the PU or performance enhancement incentives. In this work, we consider performance enhancement incentives.

   \section{Queue Stability, Primary Queue Model, and Primary Queueing Delay}
   \label{primaryqueue}
   \subsection{Stability}
Stability of a queue can be defined as follows. Let $Q^{\mathbb{T}}$ denote the length of queue $Q$ at the beginning of time slot ${\mathbb{T}}~\in~\{~1,2,3,~\dots~\}$. Queue $Q$ is said to be stable, if
\begin{equation}\label{stabilityeqn}
    \lim_{x \rightarrow \infty  } \lim_{\rm \mathbb{T} \rightarrow \infty  } {\rm Pr}\{Q^{\mathbb{T}}<x\}=1
    \end{equation}
 For the primary queue, we adopt a late-arrival model where a newly arrived packet to the queue is not served in the arriving time slot even if the queue is empty.\footnote{This queueing model is considered in many papers, see for example, \cite{sadek,simeone,erph} and the references therein.} Let $A^\mathbb{T}_{\rm p}$ denote the number of arrivals to queue $Q_{\rm p}$ in time slot $\mathbb{T}$, and $\mathcal{H}^\mathbb{T}_{\rm p}$ denote the number of departures from queue $Q_{\rm p}$ in time slot $\mathbb{T}$. The queue length evolves according to the following form:
\begin{equation}
    Q_{\rm p}^{\mathbb{T}+1}=(Q_{\rm p}^\mathbb{T}-\mathcal{H}^\mathbb{T}_{\rm p})^+ +A^\mathbb{T}_{\rm p}
\end{equation}
where $(z)^+$ denotes $\max(z,0)$. We assume that departures occur before arrivals, and the queue size is measured at the early beginning of the time slot \cite{sadek}.

   \subsection{Primary Queueing Delay}

Let $\mu_{\rm p}\!=\! \mathcal{\tilde H}_{\rm p}$, where $\mathcal{\tilde V}$ denotes the expected value of $\mathcal{V}$, be a general notation for the mean service rate of the primary queue. Solving the state balance equations of the Markov chain modeling the primary queue (Fig. \ref{MC}), it is straightforward to show that the probability that the primary queue has $k\ge 1$ packets, $\nu_k$, is given by
\begin{equation}
\nu_k=\frac{\nu_{\circ}}{\overline{\mu_{\rm p}}}\Bigg(\frac{\lambda_{\rm p} \overline{\mu_{\rm p}}}{\overline{\lambda_{\rm p} }\mu_{\rm p}}\Bigg)^{k}=\frac{\nu_{\circ}}{\overline{\mu_{\rm p}}}\eta^{k}, \ k=1,2,\dots,\infty
\label{btee7}
\end{equation}
where $\eta=\frac{\lambda_{\rm p} \overline{\mu_{\rm p}}}{\overline{\lambda_{\rm p} }\mu_{\rm p}}$.
Since the sum over all states' probabilities is equal to one, i.e., $\sum_{k=0}^{\infty}\nu_k=1$, the probability of the PU's queue being empty is obtained via solving the following equation:
\begin{equation}
\nu_{\circ}+\sum_{k=1}^{\infty}\nu_k=\nu_{\circ}+\nu_{\circ}\sum_{k=1}^{\infty}\frac{1}{\overline{\mu_p}}\eta^{k}=1
\end{equation}
After some mathematical manipulations, $\nu_{\circ}$ is given by
\begin{equation}
\nu_{\circ}\!=\!\!1-\frac{\lambda_{\rm p}}{\mu_{\rm p}}
\end{equation}
The primary queue is stable if $\mu_{\rm p}>\lambda_{\rm p}$. Applying Little's law, the primary queueing delay, $D_{\rm p}$, is then given by
\begin{equation}
\begin{split}
D_{\rm p}&=\frac{1}{\lambda_{\rm p}}\sum_{k=0}^{\infty} k \nu_k
\end{split}
\label{xxzzyy1}
\end{equation}
Using (\ref{btee7}), $D_{\rm p}$ is rewritten as
\begin{equation}
\begin{split}
D_{\rm p}&=\frac{\nu_{\circ}}{\lambda_{\rm p}\overline{\mu_p}}\sum_{k=1}^{\infty} k \eta^{k}
\end{split}
\label{xxzzyy}
\end{equation}
Substituting with $\nu_\circ$ into $D_{\rm p}$, the primary queueing delay is then given by
\begin{equation}
\begin{split}
D_{\rm p}&=\frac{1-\lambda_{\rm p}}{\mu_{\rm p}-\lambda_{\rm p}}
\end{split}
\label{delay2}
\end{equation}
Following are some important remarks. Firstly, the primary queueing delay cannot be less than one time slot, which is attained when the denominator of (\ref{delay2}) equals to the numerator. This condition implies that $\mu_{\rm p}=1$ packets/time slot, i.e., the minimum of $D_{\rm p}$ is attained if the primary service rate is equal to unity.
\begin{figure}

  \includegraphics[scale=0.5]{MCsimple}\\
  \caption{Markov chain of the PU's queue. State self-transitions are omitted for visual clarity.}\label{MC}
\end{figure}

Secondly, the primary packets average queueing delay, $D_{\rm p}$, decreases with increasing of the mean service rate of the primary queue, $\mu_{\rm p}$. On the other hand, $\mu_{\rm p}$ depends on the channels outage probabilities, which in turn are functions of the links' parameters, packet size, transmission time durations, occupied bandwidth, and many other parameters as shown in Appendices A and B.

Hereinafter, we append a second index to distinguish between cooperation (`c') and non-cooperation (`nc'). We also append a superscript to distinguish between the proposed protocols.

\section{Non-Cooperative and Cooperative Users}
\subsection{Non-Cooperative Users}
 Without cooperation, the time slot is divided into two non-overlapped phases: data transmission phase, which takes place over the time interval $[0,T-\tau_f]$; and feedback phase whose length is $\tau_f$ seconds, which takes place over the time interval $[T-\tau_f,T]$. The feedback phase is used by the primary destination to notify the primary transmitter about the decodability status of its packet. If the primary queue is nonempty, the PU transmits
exactly one packet with size $b$ bits to its respective receiver. The primary
terminal implements an Automatic Repeat-reQuest (ARQ) error control protocol. The primary receiver uses the cyclic redundancy code
(CRC) bits attached to each packet to ascertain the decodability status of the received packet. The retransmission process is
based on an acknowledgment/negative-acknowledgement (ACK/NACK) mechanism, in which short length packets are broadcasted by the primary destination to inform the primary transmitter
about its packet reception status. If the PU receives an ACK over the time interval $[T-\tau_f,T]$, the packet at its queue head leaves the system; otherwise, a retransmission of the packet is generated at the following time slot. The ARQ protocol is untruncated, which means that there is no maximum on the number of retransmissions and an erroneously received packet is retransmitted until it
is received correctly at the primary receiver \cite{simeone,erph,khattab,wcm}.

A packet at the head of the primary queue is served if the link ${\rm p \rightarrow pd}$ is not in outage. Using the results in Appendix A for the channel outages probability, the mean service rate of the primary queue, $\mu_{\rm p,nc}$, is given by
\begin{equation}
\mu_{\rm p,nc}=\!\exp\bigg(-\mathcal{N}_\circ\frac{2^{\frac{b}{W (T-\tau_f)}}-1}{P_\circ\sigma_{\rm p,pd}}\bigg)
\label{correctreceptionxxx2}
\end{equation}
It should be noted from (\ref{correctreceptionxxx2}) that increasing the feedback duration, $\tau_f$, decreases the service rate of the primary queue. This is because the time available for data transmission decreases with $\tau_f$; hence, the outage probability increases.

According to (\ref{delay2}), and using (\ref{correctreceptionxxx2}), the primary queueing delay in case of non-cooperative PU is given by
\begin{equation}
\begin{split}
D_{\rm p,nc}=\frac{1-\lambda_{\rm p}}{\mu_{\rm p,nc}-\lambda_{\rm p}}=\frac{1-\lambda_{\rm p}}{\exp\bigg(-\mathcal{N}_\circ\frac{2^{\frac{b}{W (T-\tau_f)}}-1}{P_\circ\sigma_{\rm p,pd}}\bigg)-\lambda_{\rm p}}
\end{split}
\label{190990}
\end{equation}
with $\lambda_{\rm p}\!<\!\mu_{\rm p,nc}$.

\subsection{Cooperative Users}
If the SU is available to assist with relaying primary packets, the PU
may release some spectrum to the SU for its own data transmission if cooperation is beneficial. In addition to releasing some bandwidth for the SU, the PU releases portion of its time slot duration for the SU to retransmit the primary packet. In particular, let $T$ denote the time slot duration that
a PU is allowed to transmit data over a total bandwidth of
$W$ Hz. If the cooperation is beneficial for the PU, it cooperates with the SU. If the primary queue is nonempty, it releases $W_{\rm s}\le W$ Hz to the SU for its own data transmission, and releases $T_{\rm s}$ seconds of the time slot to the SU for the possibility of relaying the primary packet. The used bandwidth for both transmission and retransmission of the primary packet is $W_{\rm p}=W\!-\!W_{\rm s}$ Hz with transmission times $T_{\rm p}$ and $T_{\rm s}$, respectively. It is assumed that the SU transmits orthogonal data over the two subbands. That is, the data sent over $W_{\rm s}$ are independent (orthogonal) of the data sent over $W_{\rm p}$. Throughout the paper, we use the analogy of subbands to distinguish between the primary operational subband, $W_{\rm p}$, and the secondary operational subband, $W_{\rm s}$.

 \subsubsection{Radio Sensing}

The SU senses the primary subband, $W_{\rm p}$, for $\tau_{\rm s}$ seconds relative to the beginning of the time slot. If this subband is sensed to be idle, the SU exploits its availability. We assume that the SU employs an energy detection spectrum sensing algorithm. Specifically, the SU gathers
a number of samples over a time duration $\tau_{\rm s}\ll T$, measures their
energy, and then compares the measured energy to a predefined threshold
to make a decision on primary activity \cite{liang2008sensing}. Detection reliability and quality depend on the sensing duration, $\tau_{\rm s}$. Specifically, as $\tau_{\rm s}$ increases, the primary detection becomes more
reliable at the expense of reducing the time available for secondary transmission over the primary subband if the PU is actually inactive. This is the essence of the sensing-throughput
tradeoff in cognitive radio systems \cite{liang2008sensing}.

Since the sensing outcome is imperfect; contains errors, the SU may interfere with the PU in case of misdetection. Let us define $P_{\rm \rm MD}$ as the probability of misdetecting the primary activity by the secondary terminal, which represents the probability of considering the PU inactive while it is actually active; and $P_{\rm \rm FA}$ as the probability that the sensor of the secondary terminal generates a false alarm, which represents the probability of considering the PU active while it is actually inactive. The values of sensing errors probabilities are derived in Appendix~C.

\subsubsection{Important Notes}
Following are some important notes about the proposed protocols.
\begin{itemize}
\item As explained in Appendix A, a link is said to be `ON' in a given time slot if its instantaneous capacity is higher than the used transmission rate, i.e., the link is not in outage. Otherwise, the link is said to be `OFF'.
\item The CSI of the links ${\rm s \rightarrow pd}$ and ${\rm s \rightarrow sd}$ are assumed to be known accurately at the SU (a similar assumption of knowing the CSI at the transmitters is found in many papers, for example, \cite{su2011active} and the references therein).\footnote{Note that the channel between the SU and the primary destination can be sent cooperatively from the primary destination. The primary destination only needs to send the state of the channel, i.e., ON or OFF, which can be done using one-bit feedback.} The SU always has data to send, and it transmits its data with the instantaneous channel capacity of its link ${\rm s \rightarrow sd}$.
\item  Since the SU has the CSI of the links, each time slot the SU ascertains the state of link ${\rm s \rightarrow pd}$, i.e., ON or OFF link, via comparing $\alpha_{\rm s,pd}$ to the decoding threshold $\alpha_{\rm th,s,pd}$.
    \item Since the secondary operation is based on the channel sensing outcomes, the time assigned for channel sensing, $\tau_{\rm s}$, is less than the primary transmission $T_{\rm p}\!>\!\tau_{\rm s}$.
\item If the link ${\rm p \rightarrow s}$ is OFF, this means that the SU will not be able to decode the primary packet as the link is in outage.
\item The SU detects the primary packet with probability $1$ due to the fact that the total number of samples per packet is huge. This means that after receiving and decoding the whole primary transmission, the SU will be able to know the actual state of the primary activity. However, this does not necessarily imply the ability of the SU to correctly decode the primary packet.
\item Each primary packet comes with a CRC. The receivers check the checksum to indicate the status of the received packet. Hence, if the SU cannot decode the primary packet in a slot, if the link ${\rm s \rightarrow pd}$ is in outage, it will not waste energy in forwarding what it receives from the wireless channel because it knows with certainty that the received packet is a noisy packet. Consequently, the SU maintains its energy from being wasted in a useless primary data retransmission, and it instead exploits that amount of energy for the transmission of its own data.
    \item The data sent over $W_{\rm s}$ are independent of the data sent over $W_{\rm p}$.
\item If the PU is active in a slot and the SU misdetects the primary activity, a concurrent transmission takes place over the primary subband $W_{\rm p}$. Hence, the secondary bits transmitted over $W_{\rm p}$ are lost, and the primary packet could survive if the received SINR is higher than the decoding threshold; this occurs with probability $\overline{\mathbb{P}^{\left(\mathcal{I}\right)}_{\rm p,pd}}$.\footnote{Throughout this paper, $\overline{\mathcal{X}}\!=\!1\!-\!\mathcal{X}$.} See Appendices A and B for further details.
    \item  We assume that the primary ARQ feedback is un-encrypted and is available to the SU. A similar assumption is found in many references, e.g., \cite{simeone,erph,khattab,wcm} and the references therein.
\item If the SU transmits concurrently with the primary receiver during the feedback phase, the feedback signal (packet) may be undecodable at the primary transmitter. For this reason, the SU remains silent during the feedback durations when the PU's queue is nonempty to avoid disturbing the primary system operation.
    \end{itemize}
 \section{First Proposed Protocol}
 \label{protocol1x}
    In this section, we explain the first proposed cooperative protocol, denoted by $\mathcal{P}_1$. The time slot structure under $\mathcal{P}_1$ is shown in Fig. \ref{timeslot1}.
    In the first proposed cooperative protocol, the operation of the SU during any arbitrary time slot changes over four phases: $[0,\tau_{\rm s}]$, $[\tau_s,T_{\rm p}]$, $[T_{\rm p}, T_{\rm p}+T_{\rm s}]$, and $[T_{\rm p}+T_{\rm s},T_{\rm p}+T_{\rm s}+\tau_f]$ (or simply $[T-\tau_f,T]$).

\begin{figure}
\center

  \includegraphics[width=1\columnwidth]{time_slot_p1}\\
  \caption{Time slot structure.}\label{timeslot1}
\end{figure}
\subsection{Protocol Description}
Before proceeding with the explanation of secondary operation during each phase, we note that, if the PU is active, the primary transmission takes place over $[0,T_{\rm p}]$ and the secondary retransmission of a primary packet takes place over $[T_{\rm p}, T_{\rm p}+T_{\rm s}]$.

\subsubsection{Time interval $[0,\tau_{\rm s}]$}
       The SU simultaneously senses the primary subband, $W_{\rm p}$, and transmits its own data over $W_{\rm s}$. The sensing outcome is then used for the secondary operation over $[\tau_{\rm s},T_{\rm p}]$.
    \subsubsection{Time interval $[\tau_{\rm s},T_{\rm p}]$}
 If the SU detects the PU to be active, it simultaneously transmits its own data over $W_{\rm s}$, and attempts to decode the primary transmission over $W_{\rm p}$. If the SU detects the PU to be inactive, it transmits its own data over both subbands $W_{\rm p}$ and $W_{\rm s}$. Note that if the PU is active and the SU finds the primary subband to be free of primary transmission, there will be interference between the PU and the SU over $W_{\rm p}$.
 \subsubsection{Time interval $[T_{\rm p},T_{\rm p}+T_{\rm s}]$}
 At the end of the primary transmission, the SU uses the received primary packet for packet detection. If the PU was inactive during the previous phase, the SU transmits over both subbands. If the links ${\rm p \rightarrow s}$ and ${\rm s \rightarrow pd}$ are simultaneously ON and the primary queue is nonempty; the SU simultaneously transmits its own data over $W_{\rm s}$ and retransmits the primary packet over $W_{\rm p}$. If either the link ${\rm p \rightarrow s}$ or ${\rm s \rightarrow pd}$ is OFF, the SU transmits its own data over both subbands.
  \subsubsection{Time interval $[T-\tau_f,T]$}
If the PU was active during $[0,T_{\rm p}]$, then its respective receiver broadcasts a feedback message to indicate the status of decodability of the packet. Hence, the SU transmits its own data over $W_{\rm s}$ and remains silent over $W_{\rm p}$ to avoid causing any interference or disturbance for the feedback signal transmission. If the PU was inactive during $[0,T_{\rm p}]$, there is no feedback signal in the current time slot; hence, the SU can exploit the availability of both subbands to transmit its own data.
\bigskip
\subsection{Primary and Secondary Rates and SU Emitted Energy}
 A packet at the head of the primary queue $Q^{\left(1\right)}_{\rm p,c}$ is served if the SU detects the primary activity correctly and either the direct path or the relaying path\footnote{The relaying path is defined as the path connecting the PU to primary destination through the SU; namely, links ${\rm p \rightarrow s}$ and ${\rm s \rightarrow pd}$. Since the channels are independent, the probability of the relaying path being not in outage is $\overline{\mathbb{P} _{\rm s,p}} \ \overline{\mathbb{P} _{\rm s,pd}} $.} is not in outage; or if the SU misdetects the primary activity and the channel ${\rm p \rightarrow pd}$ is not in outage. Let $\mu^{\left(\rm \ell\right)}_{\rm p,c}$ denote the mean service rate of the PU under protocol $\mathcal{P}_\ell$, $\ell\in\{1,2\}$. The mean service rate of the primary queue under protocol $\mathcal{P}_1$ is then given by
         \begin{equation}
\begin{split}
\label{primaryservice2}
\mu^{\left( 1\right)}_{\rm p,c}&=\overline{P}_{\rm MD}\Bigg(1-\mathbb{P}_{\rm p,pd}\Big(1-\overline{\mathbb{P} _{\rm s,p}} \,\, \overline{\mathbb{P} _{\rm s,pd}} \Big)\Bigg)\!+\!P_{\rm MD}\Bigg(1-\mathbb{P}^{\left(\mathcal{I}\right)}_{\rm p,pd}\Bigg)

    \end{split}
    \end{equation}
   where $P_{\rm MD}(1-\mathbb{P}^{\left(\mathcal{I}\right)}_{\rm p,pd})$ denotes the probability of correct primary packet reception at the primary destination when the SU misdetects the primary activity over $W_{\rm p}$.

Let $ \mathcal{   R}^{\left(\ell\right)}_{\rm e}$ and $ \mathcal{R}^{\left(\ell\right)}_{\rm b}$ denote the secondary data transmission rate under protocol $\mathcal{P}_\ell$ when the primary queue is empty and nonempty, respectively, and $R\!=\!\log_{\rm 2}\left(1\!+\!\frac{\alpha_{\rm s,sd}{P}_\circ}{\mathcal{N}_\circ}\right)\!$ denote the instantaneous capacity of link ${\rm s \rightarrow sd}$ in bits/sec/Hz.

Based on the description of protocol $\mathcal{P}_1$, the secondary data transmission rate when the primary queue is empty is given by
\begin{equation}
\begin{split}
\label{3030}
 \mathcal{   R}^{\left(1\right)}_{\rm e}&\!=\!\bigg(\!\tau_s \delta_{\rm s} \! +\! (T_{\rm p}\!-\!\tau_s) (\!P_{ \rm FA}\delta_{\rm s}\!+\!\overline{P}_{\rm \rm FA} \!)  \!+\!(\!T_{\rm s}\!+\!\tau_f\!) \!\bigg)WR
    \end{split}
    \end{equation}
where $\delta_{\rm s}\!=\!W_{\rm s}/W$. When the primary queue is nonempty, the secondary data transmission rate is given by
\begin{equation}
\begin{split}
 \mathcal{  R}^{\left(1\right)}_{\rm b}&\!=\!\bigg(\!\big(\!\tau_f\!+\! T_{\rm p}\!\big)\delta_{\rm s}\!+\!\big(P_{\rm \rm MD}\!+\!\overline{P}_{\rm MD} \mathbb{P}_{\rm p,s}\big)T_{\rm s} \!\\& \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\ +\!\overline{P}_{\rm \rm MD}\overline{\mathbb{P}}_{\rm p,s}T_{\rm s} (\overline{\mathbb{P} _{\rm s,pd}}\delta_{\rm s}\!+\!\mathbb{P} _{\rm s,pd})\!\biggr)WR
    \end{split}
    \end{equation}
Note that the term $\mathbb{P}_{\rm p,s}$ appears in $\mathcal{  R}^{\left(1\right)}_{\rm b}$ because the SU, when the link ${\rm p \rightarrow s}$ is in outage, uses the whole bandwidth for its own data transmission. Also, note that the term $\mathbb{P} _{\rm s,pd}$ appears in the expression of $\mathcal{  R}^{\left(1\right)}_{\rm b}$ because the SU, in each time slot, knows the channel state between itself and the primary destination and uses the allocated bandwidth to the PU for its own data transmission when that channel is in outage.

Let $\mathbb{I}[L]$ denote the indicator function, where $\mathbb{I}[L]=1$ if the argument is true. The secondary data transmission rate when it operates under protocol $\mathcal{P}_\ell$ is then given by
    \begin{equation}
\begin{split}
\mathcal{R}^{\left(\ell\right)}_{\rm s}=\mathbb{I}[Q^{\left(\ell\right)}_{\rm p,c}=0] \mathcal{R}^{\left(\ell\right)}_{\rm e}+\mathbb{I}[Q^{\left(\ell\right)}_{\rm p,c}\ne0]\mathcal{R}^{\left(\ell\right)}_{\rm b}
    \end{split}
    \end{equation}
The expected value of $\mathbb{I}[L]$ is equal to the probability of the argument event ${\rm Pr}\{L\}$. That is,
    \begin{equation}
\begin{split}
 \mathbb{\tilde I}[L]={\rm Pr}\{L\}
    \end{split}
    \end{equation}
 The mean secondary rate is then given by
    \begin{equation}
\begin{split}
\mathcal{\tilde R}^{\left(\ell\right)}_{\rm s}={\rm Pr}\{Q^{\left(\ell\right)}_{\rm p,c}=0\}\mathcal{ \tilde R}^{\left(\ell\right)}_{\rm e}+{\rm Pr}\{Q^{\left(\ell\right)}_{\rm p,c}\ne0\}  \mathcal{ \tilde  R}^{\left(\ell\right)}_{\rm b}
    \end{split}
    \end{equation}
Recalling that ${\rm Pr}\{Q^{\left(\ell\right)}_{\rm p,c}=0\}=\nu^{\left(\ell\right)}_{\rm \circ,c}$ and ${\rm Pr}\{Q^{\left(\ell\right)}_{\rm p,c}\ne0\}=1\!-\!\nu^{\left(\ell\right)}_{\rm \circ,c}$, the mean secondary transmission rate under protocol $\mathcal{P}_1$ is then given by
   \begin{equation}
\begin{split}
\mathcal{\tilde R}^{\left(1\right)}_{\rm s}&=\nu^{\left(1\right)}_{\rm \circ,c}\bigg(\!\tau_s \delta_{\rm s} \! +\! (T_{\rm p}\!-\!\tau_s) (\!P_{ \rm FA}\delta_{\rm s}\!+\!\overline{P}_{\rm \rm FA} \!)  \!+\!(\!T_{\rm s}\!+\!\tau_f\!) \!\bigg)W\mathcal{G}_{P_\circ}\!\\& +\!\overline{\nu^{\left(1\right)}_{\rm \circ,c}}\bigg(\!\big(\!\tau_f\!+\! T_{\rm p}\!\big)\delta_{\rm s}\!+\!\big(P_{\rm \rm MD}\!+\!\overline{P}_{\rm MD} \mathbb{P}_{\rm p,s}\big)T_{\rm s} \!\\ & \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\ +\!\overline{P}_{\rm \rm MD}\overline{\mathbb{P}}_{\rm p,s}T_{\rm s} (\overline{\mathbb{P} _{\rm s,pd}}\delta_{\rm s}\!+\!\mathbb{P} _{\rm s,pd})\!\biggr)W\mathcal{G}_{P_\circ}
    \end{split}
    \end{equation}
where $\mathcal{G}_{P_\circ}$ is the expected value of $\log_2(1+\alpha_{\rm s,sd}\frac{{P_\circ}}{\mathcal{N}_\circ})$, which is given by (see Appendix D for details)
                 \begin{equation}
\begin{split}
\mathcal{G}_{P_\circ}& = \frac{1}{\ln(2)} \exp(\frac{1}{\frac{{P_\circ}}{\mathcal{N}_\circ}\sigma_{\rm s,sd}}) \Gamma(0,\frac{1}{\frac{{P_\circ}}{\mathcal{N}_\circ}\sigma_{\rm s,sd}})
    \end{split}
    \end{equation}
where $\Gamma(m,s)=\int_{1/s}^{\infty}\exp(-{z}) {z}^{m-1} dz$ is the upper incomplete Gamma function.

According to the described protocol, the secondary mean transmit energy is given by
    \begin{equation}
\begin{split}
\label{eeeccn}
\mathcal{E}_{ 1}&=\nu^{\left(1\right)}_{\rm \circ,c}\bigg(\!\tau_s \delta_{\rm s} \! +\! (T_{\rm p}\!-\!\tau_s) ( P_{\rm \rm FA}\delta_{\rm s}\!+\!\overline{P}_{\rm \rm FA}) \!+\!T_{\rm s}\!+\!\tau_f \bigg)WP_\circ \\&+\! \overline{\nu^{\left(1\right)}_{\rm \circ,c}}\biggr(\!(\tau_f\!+\!\tau_{\rm s}) \delta_{\rm s}\!+\!(T_{\rm p}\!-\!\tau_{\rm s})(\overline{P}_{\rm MD}\delta_{\rm s}\!+\!P_{\rm MD})\!+\! T_{\rm s}\!\biggr)WP_\circ
    \end{split}
    \end{equation}
    Note that we assume that the maximum average emitted secondary energy is $E$; hence, $\mathcal{E}_1$ must be at most $E$.

\section{Second Proposed protocol}
 \label{protocol2x}
 In the second protocol, denoted by $\mathcal{P}_2$, we assume significant variation in the primary feedback mechanism. More specifically, we assume the existence of two primary feedback phases within each time slot. Each transmission of the primary packet by either the PU or the SU is followed by a feedback phase to inform the transmitter about the decodability of the packet. In other words, a feedback signal is sent by the primary destination when it receives a copy of the expected primary packet.\footnote{Note that each packet comes with an identifier (ID) and a certain labeled number that is generated by the transmitter. In addition, the destination sends the expected number of the next packet as part of the feedback message.} The first feedback phase is preceded by the primary transmission of the primary packet, whereas the second feedback phase is preceded by the secondary transmission of the primary packet. The primary queue drops the packet if it gets at least one ACK in any time slot. Otherwise, the packet will be retransmitted by the PU in the following time slots until its correct reception at the primary destination.

 On one hand, the gain of this protocol over the first protocol is its ability to prevent unnecessary retransmission of a successfully received primary packet at the primary destination. That is, if the primary destination can decode the primary transmission correctly, then there is no need to retransmit the primary packet over the primary subband and the time assigned for relaying; hence, the SU can use the time assigned for relaying and the primary subband for its own data transmission.\footnote{This is because the retransmission of the primary packet by the secondary transmitter does not provide further contribution to the primary throughput. In addition, the retransmission of the primary packet causes both energy and bandwidth losses that can be used otherwise for the secondary data transmission.} Consequently, using protocol $\mathcal{P}_2$ enables the SU to increase its average transmission rate via using the primary bandwidth, relaying assigned time duration and its energy to send its own data. On the other hand, there is a considerable cost due to appending an extra feedback duration to the time slot. This cost is converted to the increase of the outage probabilities of the links and the reduction of the users' rates. This is because the total time for data and packets transmission is reduced by $\tau_f$ seconds relative to the total transmission time in case of protocol $\mathcal{P}_1$.

 Under protocol $\mathcal{P}_2$, the secondary operation in any arbitrary time slot is composed of five phases as shown in Fig. \ref{timeslot2}: $[0,\tau_{\rm s}]$, $[\tau_s,T_{\rm p}]$, $[T_{\rm p},T_{\rm p}+\tau_f]$, $[T_{\rm p}\!+\!\tau_f, T_{\rm p}\!+\!\tau_f\!+\!T_{\rm s}]$ and $[T\!-\!\tau_f,T]$.

\subsection{Reception of Primary Feedback Message at The SU}
     The correctness of the feedback reception at the secondary terminal is ascertained using the checksum appended to the feedback packet. The reception of a primary feedback message at the secondary transmitter can be modeled as an erasure channel model. In particular, the primary feedback message is assumed to be received correctly at the secondary terminal with probability $f$. If the secondary terminal cannot decode the primary feedback signal in a time slot,\footnote{This event is referred to as ``nothing" event. The `nothing' event is considered when the SU fails in decoding the feedback message, or when the PU is idle at this slot, i.e., $Q_{\rm p}=0$. It is worth noting here that if the primary is inactive/active in an arbitrary slot, the SU knows this event with probability $1$ as explained earlier that a pure noise packet is detected with probability $1$.} it considers this feedback message as a NACK feedback. Another possibility is to assume that the SU considers the ``nothing" as a NACK message with probability $\omega$ and considers it as an ACK message with probability $\overline{\omega}$. Using such parameter allows the SU to use a fraction of the ``nothing" event that would be an ACK, which means that the SU does not need to retransmit the primary packet, for its own data transmission. The SU optimizes over $\omega$ to alleviate wasting the channel resources without further contribution to the primary service rate when the primary packet is already received successfully at the primary destination. The primary mean service rate in this case is given by

         \begin{equation}
\begin{split}
\label{primaryservice2x}
\mu^{\left(\rm 2\right)}_{\rm p,c}\!=\!\overline{P}_{\rm MD}\Bigg(1\!-\!\mathbb{P}_{\rm p,pd}\Big(1\!-\!\beta\overline{\mathbb{P}_{\rm s,p}} \,\, \overline{\mathbb{P}_{\rm s,pd}} \Big)\Bigg)\!+\!P_{\rm MD}\Bigg(1\!-\!\mathbb{P}^{\left(\mathcal{I}\right)}_{\rm p,pd}\Bigg)
    \end{split}
    \end{equation}
    where $\beta\!=f\!+\!\overline{f}{\omega}$ is the probability of considering the overheard feedback message as a NACK when the primary destination sends a NACK feedback (which occurs if link ${\rm p\rightarrow pd}$ is in outage). From (\ref{primaryservice2x}), the primary mean service rate is parameterized by $\omega$. The maximum primary service rate is attained when $\omega=1$. For the sake of simplicity, we consider the case of $\omega\!=\!1$, which guarantees the highest QoS for the PU.
\subsection{Protocol Description}
Note that the primary transmission occurs over $[0,T_{\rm p}]$ and the secondary retransmission of a primary packet occurs over $[T_{\rm p}\!+\!\tau_f, T_{\rm p}\!+\!\tau_f\!+\!T_{\rm s}]$. Note also that the feedback signal is considered by the SU as a NACK feedback 1) if the link ${\rm p \rightarrow pd}$ is in outage and the feedback message is decoded correctly at the SU terminal; or 2) if the feedback signal is undecodable at the secondary transmitter. The probability that the SU considers the overheard primary feedback message as a NACK is then given by
   \begin{equation}
\begin{split}
\Gamma_f\!=\!\mathbb{P}_{\rm p,pd} f \!+\!\overline{f}
  \end{split}
    \end{equation}
    The behavior of the SU during each phase is described as follows.
\subsubsection{Time interval $[0,\tau_{\rm s}]$ and $[\tau_{\rm s},T_{\rm p}]$}
The operation of the system over the time intervals $[0,\tau_{\rm s}]$ and $[\tau_{\rm s},T_{\rm p}]$ are similar to the first protocol.
   \subsubsection{Time interval $[T_{\rm p},T_{\rm p}+\tau_f]$}
  If the primary queue is nonempty during the time slot, at the end of the primary transmission, the SU transmits its own data over $W_{\rm s}$, and remains silent over $W_{\rm p}$ to avoid causing a concurrent transmission with the feedback signal at the primary transmitter. If the primary queue is empty during the time slot, the SU transmits its data over both subbands.
 \subsubsection{Time interval $[T_{\rm p}+\tau_f,T-\tau_f]$}
 Upon decoding the primary full packet, the SU discerns the actual state of the PU, i.e., active or inactive. If the PU is active, the primary receiver correctly decodes the primary transmission and the SU successfully decodes the primary feedback signal, i.e., considers it as an ACK feedback. On the other hand, if the link ${\rm s \rightarrow pd}$ is in outage; or if the PU was inactive during $[0,T_{\rm p}]$, the SU transmits its own data over both subbands. If the PU was active during $[0,T_{\rm p}]$, the secondary terminal considers the feedback signal as a NACK feedback, and the link ${\rm s \rightarrow pd}$ is not in outage; the SU simultaneously transmits its own data over $W_{\rm s}$ and retransmits the primary packet over $W_{\rm p}$.

\subsubsection{Time Interval $[T-\tau_f,T]$}
If the SU retransmitted the packet over $[T_{\rm p}+\tau_f,T-\tau_f]$, another feedback signal will be sent over this phase by the primary destination. Hence, the SU simultaneously transmits its own data over $W_{\rm s}$ and remains silent over $W_{\rm p}$. If the SU decided not to retransmit the primary packet, there will be no primary feedback signal. Therefore, the SU transmits its own data over both subbands. If the primary queue is empty during the time slot, the SU transmits its own data over both subbands.
\subsection{Primary and secondary rates, and the SU emitted energy}
A packet at the head of the primary queue $Q^{\left(2\right)}_{\rm p,c}$ is served 1) if the SU detects the primary activity correctly, and the direct link is not in outage; 2) if the SU detects the primary activity correctly, and the direct link is in outage, the SU considers the primary feedback message as a NACK signal, and the relaying link is not in outage; or 3) if the SU misdetects the primary activity, and the direct link is not in outage. The mean service rate of the primary queue is similar to the first protocol and is given by
   \begin{equation}
\begin{split}
\label{primaryservice222}
\mu^{\left( 2\right)}_{\rm p}=\overline{P}_{\rm MD}\Bigg(1-\mathbb{P}_{\rm p,pd}\Big(1-\overline{\mathbb{P} _{\rm s,p}} \,\, \overline{\mathbb{P} _{\rm s,pd}} \Big)\Bigg)\!+\!P_{\rm MD}\Bigg(1-\mathbb{P}^{\left(\mathcal{I}\right)}_{\rm p,pd}\Bigg)
    \end{split}
    \end{equation}
We note that the expression (\ref{primaryservice222}) is similar to (\ref{primaryservice2}), however, the maximum assigned data transmission times for users under $\mathcal{P}_2$ are lower than $\mathcal{P}_1$ as $\mathcal{P}_2$ is composed of two feedback durations.

When the primary is inactive, the secondary transmission rate is given by
    \begin{equation}
\begin{split}
\label{3030}
 \mathcal{   R}^{\left(2\right)}_{\rm e}&\!=\!\Big(\!\tau_s \delta_{\rm s} \!+\! (T_{\rm p}\!-\!\tau_s)\big(\overline{P}_{\rm \rm FA}   \!+\!  P_{\rm \rm FA} \delta_{\rm s}\!\big) \!+\!\!T_{\rm s}\!+\!2\tau_f\Big)WR
    \end{split}
    \end{equation}

    \begin{figure}
\centering

  \includegraphics[width=1\columnwidth]{time_slot_p2}\\
  \caption{System operation.}\label{timeslot2}
\end{figure}
When the PU is active, the secondary transmission rate is given by
    \begin{equation}
\begin{split}
\label{2000}
 \mathcal{  R}^{\left(2\right)}_{\rm b}&\!=\!\Bigg(\!(2\tau_f \!+\!T_{\rm p})\delta_{\rm s}\!+\! \overline{P}_{\rm \rm MD}T_{\rm s}\\& \,\,\,\,\ \times \bigg(\!\overline{\mathbb{P} _{\rm p,s}}(\!\Gamma_f (\overline{\mathbb{P} _{\rm s,pd}}\delta_{\rm s}\!+\!\mathbb{P} _{\rm s,pd}) \! \!+\! \overline{\Gamma}_f)\!+\!\mathbb{P} _{\rm p,s} \!\bigg) \! +\! P_{\rm \rm MD}\!T_{\rm s}\!\Bigg) WR\!
    \end{split}
    \end{equation}
 The mean secondary transmission rate is then given by
   \begin{equation}
\begin{split}
 \mathcal{ \tilde  R}^{\left(2\right)}_{\rm s}&=\nu^{\left(2\right)}_{\rm \circ,c}\Bigg(\!\tau_s \delta_{\rm s} \!+\! (T_{\rm p}\!-\!\tau_s)\big(\overline{P}_{\rm \rm FA}   \!+\!  P_{\rm \rm FA} \delta_{\rm s}\!\big) \!+\!\!T_{\rm s}\!+\!2\tau_f\Bigg)W\mathcal{G}_{P_\circ} \\& \,\,\,\,\,\,\,\ + \overline{\nu^{\left(2\right)}_{\rm \circ,c}} \Bigg(\!(\!2\tau_f \!+\!T_{\rm p})\delta_{\rm s}\!+\! \overline{P}_{\rm \rm MD}T_{\rm s}\\& \,\ \times\! \bigg(\!\overline{\mathbb{P} _{\rm p,s}}(\!\Gamma_f (\!\overline{\mathbb{P} _{\rm s,pd}}\delta_{\rm s}\!+\!\mathbb{P} _{\rm s,pd}) \! \!+\! \overline{\Gamma}_f)\! +\!\mathbb{P} _{\rm p,s} \!\bigg) \!  +\! P_{\rm \rm MD}\!T_{\rm s}\!\Bigg) W\mathcal{G}_{P_\circ}
    \end{split}
    \end{equation}

According to the description of protocol $\mathcal{P}_2$, the mean transmit secondary energy is given by
    \begin{equation}
\begin{split}
\mathcal{E}_{2}&=\nu^{\left(2\right)}_{\rm \circ,c}\Big(\!\tau_s \delta_{\rm s} \!+\! (T_{\rm p}\!-\!\tau_s)\big(\overline{P}_{\rm \rm FA}   \!+\!  P_{\rm \rm FA} \delta_{\rm s}\!\big) \!+\!\!T_{\rm s}\!+\!2\tau_f \Big)WP_\circ\\&+ \overline{\nu^{\left(2\right)}_{\rm \circ,c}}\Big(\!(2\tau_f \!+\!\tau_{\rm s}) \delta_{\rm s}\!+\!(T_{\rm p}\!-\!\tau_{\rm s})(\overline{P}_{\rm MD}\delta_{\rm s}\!+\!P_{\rm MD}) \! +\!T_{\rm s}\!\Big) WP_\circ
    \end{split}
    \end{equation}

\section{Problem Formulation and Primary Mean Energy Savings}
\subsection{Problem Formulation}
        We assume that users optimize over $T_{\rm p}=T-T_{\rm s}$ and $W_{\rm p}=W-W_{\rm s}$. Note that there is a possibility to optimize over the sensing time $\tau_{\rm s}$, however, for simplicity, we assume that the sensing time is fixed and predetermined. Sensing time optimization is out of scope of this paper. The optimization problem is stated such that the secondary average rate is maximized under specific primary queueing delay, primary queue stability, and an energy constraint on the secondary average transmit energy, $\mathcal{E}_{\rm \ell}\le E$ (where $E$ is the maximum average transmit energy). The optimization problem under protocol $\mathcal{P}_\ell$ can be stated as follows:
\begin{equation}
\begin{split}
\label{opt1}
      \underset{\substack{{T_{\rm p},W_{\rm p}}}}{\max.}&\,\,\,\,\,\,\,\,\,\,\  \mathcal{ \tilde  R}^{\left(\ell\right)}_{\rm s} \\ {\rm s.t.}&  \,\,\,\,\,\,\,\,\,\ D^{\left({\rm \ell}\right)}_{\rm p,c} < D_{\rm p,nc}, \ \mu^{\left(\ell\right)}_{\rm p,c}>\lambda_{\rm p},\  0\!\le\! \mathcal{E}_{ \rm \ell}\!\le\! E, \\& \,\,\ \ \tau_{\rm s}\!\le\! T_{\rm p}\!\le\! \mathcal{T}^{\left(\!\ell\right)},  \ 0\!\le\! W_{\rm p}\!\le\! W, \ T_{\rm p}\!+\!T_{\rm s}\!=\!\mathcal{T}^{\left(\!\ell\right)}
    \end{split}
    \end{equation}
where $\mathcal{T}^{\left(\ell\right)}$ is the operational constraint on $T_{\rm p}\!+\!T_{\rm s}$ when users operate under protocol $\mathcal{P}_\ell$, and $D^{\left({\rm \ell}\right)}_{\rm p,c}=(1-\lambda_p)/(\mu^{\left(\rm \ell\right)}_{\rm p,c}-\lambda_{\rm p})$. Under the first protocol, the total allowable transmission time is $T\!-\!\tau_f$; hence, $\mathcal{T}^{\left(1\right)}=T\!-\tau_f$. Whereas under the second protocol, the total allowable transmission time is $T\!-\!2\tau_f$; hence, $\mathcal{T}^{\left(2\right)}=T\!-2\tau_f$. It should be pointed out here that if the primary feedback message is always undecodable at the secondary transmitter, i.e., $f\!=\!1$, or if the link ${\rm p\rightarrow pd}$ is always in outage; protocol $\mathcal{P}_1$ always outperforms protocol $\mathcal{P}_2$. This is because the SU always retransmits the primary packet with a lower transmission time for each user due to the existence of two feedback durations in $\mathcal{P}_2$. In addition, when $\tau_f$ increases, $\mathcal{P}_1$ may outperform $\mathcal{P}_2$ because it may be the case that the reduction of the allowable total transmission time due to the presence of an additional feedback duration is higher than the gain of knowing the status of the primary packet decodability before the secondary retransmission of the primary packet.

The optimization problem (\ref{opt1}) is solved numerically using a 2D grid search over $T_{\rm p}$ and $W_{\rm p}$. The optimal parameters obtained via solving the optimization problem (\ref{opt1}) are announced to both users so that $W_{\rm p}$ and $T_{\rm p}$ are known at the PU and the SU before actual operation. If the optimization problem is infeasible due to the dissatisfaction of one or more of the constraints, the SU will not be allowed to use the spectrum.

 It is worth noting that the primary queueing delay constraint can be replaced by a constraint on the mean service rate of the primary queue. Since the delay constraint is $D^{\left({\rm \ell}\right)}_{\rm {\rm p},c}=(1-\lambda_{\rm p})/(\mu^{\left(\rm \ell\right)}_{\rm p,c}-\lambda_{\rm p})\!<\! D_{\rm p,nc}\!=\!(1-\lambda_{\rm p})/(\mu_{\rm p,nc}-\lambda_{\rm p})$, the mean service rate of the primary queue with cooperation must be greater than the mean service rate of the primary queue without cooperation. That is,

\begin{equation}
\begin{split}
\label{optccc}
\mu^{\left(\rm \ell\right)}_{\rm p,c}> \mu_{\rm p,nc}
    \end{split}
    \end{equation}
    Combining the delay constraint and the stability constraint, hence the primary mean service rate should be at least
    \begin{equation}
\begin{split}
\label{optccc}
\mu^{\left(\rm \ell\right)}_{\rm p,c}> \max\Big\{\mu_{\rm p,nc},\lambda_{\rm p}\Big\}
    \end{split}
    \end{equation}

\subsection{Mean Primary Energy Savings}
In the absence of relaying, the PU data transmission
takes place over $T\!-\!\tau_f$ seconds and occupies $W$ Hz, and the PU energy consumption per time slot amounts to $P_\circ W (T\!-\!\tau_f)$ joules/slot. However,
when CR relaying takes place, the PU transmits
only in $T_{\rm p}/T$ of the time slot with transmission bandwidth $W_{\rm p}$ Hz, so its energy consumption per time slot
is only $P_\circ W_{\rm p} T_{\rm p}$ joules/slot. In this case, the average rate of the PU energy savings, defined as the ratio of the energy savings
over the original energy consumption, is given by
\begin{equation}
\begin{split}
\phi\!=\! \frac{P_\circ W (T\!-\!\tau_f) {\rm Pr}\{Q_{\rm p,nc}\ne0\}-\!P_\circ W_{\rm p} T_{\rm p} {\rm Pr}\{Q^{\left(\ell\right)}_{\rm p,c}\ne0\}}{P_\circ W (T\!-\!\tau_f) {\rm Pr}\{Q_{\rm p,nc}\ne0\}}
    \end{split}
    \end{equation}
    Using the fact that ${\rm Pr}\{Q_{\rm p,nc}\ne0\}\!=\!\lambda_{\rm p}/\mu_{\rm p,nc}$ if $\lambda_{\rm p}<\mu_{\rm p,nc}$, and $1$ otherwise, ${\rm Pr}\{Q^{\left(\ell\right)}_{\rm p,c}\ne0\}\!=\!\lambda_{\rm p}/\mu^{\left(\ell\right)}_{\rm p,c}$, and noting that there is no cooperation if the primary queue is unstable, we get
    \begin{equation}
\begin{split}
\phi\!=\! 1-\frac{W_{\rm p} T_{\rm p}} {W (T\!-\!\tau_f)}\frac{\max\{\mu_{\rm p,nc},\lambda_{\rm p}\}}{\mu^{\left(\ell\right)}_{\rm p,c}}
    \end{split}
    \end{equation}
From the above ratio, we can see that the less the bandwidth and the transmission time
that the PU occupies, the more energy
savings for the PU. We note that the primary queue under cooperation should be stable, otherwise, the optimization problem is infeasible and there will be no cooperation. We also note that using less bandwidth
and shorter transmission time improves the low probability of intercept/low probability of detection (LPD/LPI) characteristics of the communication link that appears
to be especially critical in military applications \cite{su2011active}.

\section{Numerical results}
 \label{numerical}
In this section, we present some simulations of the proposed cooperative protocols. We define a set of common parameters: the targeted false alarm probability is $P_{\rm FA}=0.1$, $W\!=\!10$ MHz, $T=5$ msec, $b\!=\!5000$ bits, $E\!=\!5\times 10^{-6}$ joule, $\tau_{\rm s}\!=\!0.05T$, $\sigma_{\rm s,pd}\!=\!\sigma_{\rm s,sd}\!=\!0.1$, $\sigma_{\rm p,s}\!=\!1$, $\mathcal{P}_\circ\!=\!10^{-10}$ Watts/Hz, and $\mathcal{N}_\circ=10^{-11}$ Watts/Hz. Fig. \ref{fig1} shows the maximum average secondary rate of the proposed cooperative protocols. The second protocol is plotted with three different values of $f$. The figure reveals the advantage of the second protocol over the first protocol for $f=0.5$ and $f=1$. However, for $f=0$, the first protocol outperforms the second one. This is because when $f=0$ there is no beneficial gain of having a feedback signal after the primary transmission; hence, using the second protocol wastes $\tau_f$ seconds of the time slot that can be used otherwise in increasing users' rates. The figure also reveals the impact of parameter $f$ on the performance of protocol $\mathcal{P}_2$. As shown in the figure, increasing $f$ enhances the performance of protocol $\mathcal{P}_2$. In addition to the common parameters, the figure is generated using $\sigma_{\rm p,pd}\!=\!0.05$, $\tau_f=0.05T$ and the values of $f$ in the figure's legend.

Fig. \ref{fig2} demonstrates the impact of the feedback duration, $\tau_f$, on the performance of the proposed cooperative protocols. The mean secondary transmission rate and the primary arrival rate feasible range shrink with increasing $\tau_f$. When the value of $\tau_f$ is considerable, i.e., $\tau_f=0.2T$, the first protocol outperforms the second protocol. This is because the total allowable transmission time of nodes in $\mathcal{P}_2$ in this case is $T\!-\!2\tau_f\!=\!0.6T$, whereas the total allowable transmission time for $\mathcal{P}_1$ is $T\!-\!\tau_f\!=\!0.8T$. For small values of $\tau_f$, the second proposed protocol outperforms the first protocol. This is because the SU can use the time duration assigned for relaying and the primary subband to transmit its data in case of correct packet reception after the primary transmission. The parameters used to generate the figure are the common parameters, $\sigma_{\rm p,pd}\!=\!0.05$, $f=1$ and the values of $\tau_f$ in the plot.

Figs. \ref{fig3}, \ref{fig4} and \ref{fig5} present the primary mean service rate, the primary queueing delay, and the average PU power savings, respectively, under the proposed cooperative protocols. The case of non-cooperative users is also plotted in Figs. \ref{fig3} and \ref{fig4} for comparison purposes. The figures demonstrate the gains of the proposed protocols for the PU over the non-cooperation case. Note that without cooperation, the primary queue is unstable when $\lambda_{\rm p}>0.2$ packets/slot. On the other hand, with cooperation, the primary queue remains stable over the range from $\lambda_{\rm p}=0$ to $\lambda_{\rm p}=0.95$ packets/slot. The second protocol provides better performance than the first protocol in terms of primary quality of service. Fig. \ref{fig5} reveals that more that 95\% of the average primary energy will be saved for $\lambda_{\rm p}=0.2$ packets/slot. When $\lambda_{\rm p}\!=\!0.8$ packets/slot, the primary energy savings is almost 78\%. For $\lambda_{\rm p}\ge 0.95$, the primary queue becomes unstable even with cooperation; hence, the cooperation becomes non-beneficial for the PU. Consequently, the PU ceases cooperation, the SU doest gain any access to the spectrum, and the primary energy savings becomes zero. The parameters used to generate the figures are the common parameters, $\sigma_{\rm p,pd}\!=\!0.005$, $\sigma_{\rm s,pd}\!=\!1$, $\tau_f=0.05T$ and $f\!=\!1$. Note that the performance of both protocols are close to each other because the outage of the primary channel is high and the direct link ${\rm p \rightarrow pd}$ is in outage most of the time. Hence, under $\mathcal{P}_2$, the SU retransmits the primary packet almost every slot instead of transmitting its own data. Accordingly, both protocols almost provide the same performance.

\begin{figure}[h]
	\centering
		\includegraphics[scale=0.5]{fig1}
	\caption{The maximum secondary rate in bits per slot for the proposed protocols. Protocol $\mathcal{P}_2$ is plotted with three different values of primary feedback correct reception, $f$.}
	\label{fig1}
\end{figure}
\begin{figure}[h]
	\centering
		\includegraphics[scale=0.5]{fig2}
	\caption{The maximum mean secondary rate in bits per slot. The protocols are plotted for two values of the feedback duration $\tau_f$.}
	\label{fig2}
\end{figure}

\begin{figure}[h]
	\centering
		\includegraphics[scale=0.5]{fig3}
	\caption{The maximum mean primary stable throughput for the proposed protocols. The case of non-cooperative users is also plotted for comparison.}
	\label{fig3}
\end{figure}
\begin{figure}[h]
	\centering
		\includegraphics[scale=0.5]{fig4}
	\caption{The primary queueing delay for the proposed protocols. The case of non-cooperative SU is also plotted for comparison purposes.}
	\label{fig4}
\end{figure}
\begin{figure}[h]
	\centering
		\includegraphics[scale=0.5]{phi}
	\caption{PU power savings.}
	\label{fig5}
\end{figure}
\section{Conclusion}
\label{conc}
In this paper, we have developed two cooperative cognitive protocols which allow the SU to access the spectrum simultaneously with the PU. We have shown the gains of the proposed protocols for the SUs. We also addressed the impact of the feedback process on users rates. Each of the proposed protocols can outperform the other for certain parameters.
\section*{Appendix A}
In this Appendix, we present the outage probability expression of a link when the transmitter communicates to its respective receiver alone, i.e., without interference. Let $r_{\rm j,k}$ be the transmission rate of node ${\rm j}$ while communicating to node ${\rm k}$, $\gamma_{\rm j,k}$ be the received SNR at node ${\rm k}$ when node ${\rm j}$ communicates with node ${\rm k}$, and $\alpha_{\rm j,k}$ be the associated channel gain with mean $\sigma_{\rm j,k}$, which is exponentially distributed in the case of Rayleigh fading. The probability of channel outage between ${\rm j}$ and ${\rm k}$ is given by \cite{krikidis2010stability}
\begin{equation}\label{correctreceptionx}
\begin{split}
\mathbb{P}_{\rm j,k}&= {\rm Pr}\biggr\{r_{\rm j,k}>\log_2\bigg(1+\gamma_{\rm j,k}\bigg)\biggr\}
\end{split}
\end{equation}
where ${\rm Pr}\{\cdot\}$ denotes the probability of the event in the argument and $\gamma_{\rm j,k}~=~\frac{P_\circ\alpha_{\rm j,k}}{\mathcal{N}_\circ}$. The formula (\ref{correctreceptionx}) can be rewritten as
\begin{equation}\label{correctreception}
\begin{split}
\mathbb{P}_{\rm j,k}&= {\rm Pr}\biggr\{\alpha_{\rm j,k}<\frac{\mathcal{N}_\circ}{P_\circ}\Big(2^{\frac{r_{\rm j,k}}{W}}-1\Big)\biggr\}
\end{split}
\end{equation}

 Let $\alpha_{\rm th,j,k}\!=\!\frac{\mathcal{N}_\circ}{P_\circ}(2^{\frac{r_{\rm j,k}}{W}}\!-\!1)$. We note that if $\alpha_{\rm j,k}< \alpha_{\rm th,j,k}$, the channel is in outage (OFF), whereas if $\alpha_{\rm j,k}\!\ge\!\alpha_{\rm th,j,k}$, the channel is not in outage (ON). It is worth pointing out here that increasing the data transmission time and the bandwidth assigned to any of the terminals decrease the outage probability, or equivalently increase the capacity, of the link between that terminal and its respective receiver. That is, the outage probability of any of the links decreases exponentially with the increase of the transmission time and the bandwidth assigned to the terminals.

  If the SU is available to assist, when the PU's queue is nonempty, the PU sends a packet of size $b$ bits over $T_{\rm p}$. Hence, the primary transmission rate is given by
\begin{equation}
r_{\rm p,pd}=\frac{b}{T_{\rm p}}
\label{r_i}
\end{equation}
When the PU communicates to its receiver lonely, i.e., without interference, the link between the PU and the primary destination (link ${\rm p \rightarrow pd}$) is in outage with probability
\begin{equation}\label{correctreceptionww}
\mathbb{P}_{\rm p,pd}=1-\exp\bigg(-\mathcal{N}_\circ\frac{2^{\frac{b}{W_{\rm p} T_{\rm p}}}-1}{P_\circ\sigma_{\rm p,pd}}\bigg)
\end{equation}

The SU relays (retransmits) the primary packet over $T_{\rm s}$ seconds. Hence, the transmission rate of the relayed primary packet is given by
\begin{equation}
r_{\rm s,pd}=\frac{b}{T_{\rm s}}
\label{r_i}
\end{equation}
The probability of primary packet correct reception at the SU is equal to the probability of the link ${\rm p \rightarrow s}$ being not in outage. This is given by a formula similar to the one in (\ref{correctreceptionww}) with the relevant parameters of the link ${\rm p \rightarrow s}$. That is,
\begin{equation}\label{correctreception}
\overline{\mathbb{P} _{\rm p,s}}=\exp\bigg(-\mathcal{N}_\circ\frac{2^{\frac{b}{W_{\rm p} T_{\rm p}}}-1}{P_\circ\sigma_{\rm p,s}}\bigg)
\end{equation}

The relayed primary packet transmitted by the SU is correctly received at the primary destination with probability
\begin{equation}
\label{correctreceptionxxx22}
\overline{\mathbb{P} _{\rm s,pd}}=\exp\bigg(-\mathcal{N}_\circ\frac{2^{\frac{b}{W_{\rm p} T_{\rm p}}}-1}{P_\circ\sigma_{\rm s,pd}}\bigg)
\end{equation}
where (\ref{correctreceptionxxx22}) is the probability that link ${\rm s \rightarrow pd}$ is not in outage.
\section*{Appendix B}
When the SU and the PU transmit at the same time over the primary subband, the outage event of the link ${\rm p \rightarrow pd}$ is given by
\begin{equation}
\begin{split}
\mathbb{P}^{\left(\mathcal{I}\right)}_{\rm j,k}&= {\rm Pr}\biggr\{\frac{b}{T_{\rm p}W_{\rm p}}>\log_2\bigg(1+\frac{\alpha_{\rm p,pd}P_\circ}{\mathcal{N}_\circ+\alpha_{\rm s,pd}P_\circ}\bigg)\biggr\}
\end{split}
\end{equation}
This can be written as
\begin{equation}
\begin{split}
\mathbb{P}^{\left(\mathcal{I}\right)}_{\rm j,k}&= {\rm Pr}\biggr\{2^{\frac{b}{T_{\rm p}W_{\rm p}}}-1>\frac{\alpha_{\rm p,pd}P_\circ}{\mathcal{N}_\circ+\alpha_{\rm s,pd}P_\circ}\biggr\}
\end{split}
\end{equation}
Since the channels are independent, the region, where the inequality $2^{\frac{b}{T_{\rm p}W_{\rm p}}}-1>\frac{\alpha_{\rm p,pd}P_\circ}{\mathcal{N}_\circ+\alpha_{\rm s,pd}P_\circ}$ is satisfied, can be easily solved. After some algebra, the probability of primary packet correct reception when the SU interrupts the primary transmission over $W_{\rm p}$ is given by
\begin{equation}
\overline{\mathbb{P}^{\left(\mathcal{I}\right)}_{\rm p,pd}}=\frac{\overline{\mathbb{P}_{\rm p,pd}}}{1+\frac{\sigma_{\rm s,pd}}{\sigma_{\rm p,pd}}(2^{\frac{b}{W_{\rm p} T_{\rm p}}}-1)}
\label{correctreceptionww2}
\end{equation}
From expression (\ref{correctreceptionww2}), the successful transmission in case of interference is outer bounded by $\overline{\mathbb{P}_{\rm p,pd}}$. This shows the reduction of primary throughput due to concurrent transmission which may occur because of sensing error events.

\section*{Appendix C}

 We derive here the sensing errors probabilities at the SU. The detection
problem at slot $\mathbb{T}$ (assuming that $\tau_{\rm s} F_{\rm s}$ is an integer, where $F_{\rm s}\!=\!2W_{\rm p}$ is the sampling frequency of spectrum sensing \cite{liang2008sensing} and $W_{\rm p}$ is the primary bandwidth in case of cooperation) is described as follows:
\begin{equation}
\begin{split}
\mathcal{H}_1&: \ s(\hat k)=\zeta_{\rm p,s} x(\hat k)+\varepsilon(\hat k)\\
\mathcal{H}_0&: \ s(\hat k)=\varepsilon(\hat k)
     \end{split}
    \end{equation}

\begin{equation}
\begin{split}
\mathbb{H}(s)=\frac{1}{F_{\rm s}\tau_{\rm s}} \sum_{\hat k=1}^{F_{\rm s}\tau_{\rm s}} |s(\hat k)|^2
     \end{split}
    \end{equation}
where $|\zeta_{\rm p,s}|^2=\alpha_{\rm p,s}$ is channel gain of link ${\rm p \rightarrow s}$, hypotheses $\mathcal{H}_1$ and $\mathcal{H}_0$ denote the cases where the PT is active and inactive, respectively, $\tau_{\rm s} F_{\rm s}$ is the total number of used samples for primary activity detection, $\varepsilon$ is the noise instantaneous value at time slot $\mathbb{T}$ with variance $\mathcal{N}_{\rm p}=\mathcal{N}_\circ W_{\rm p}$, $x$ is the primary transmitted signal at slot $\mathbb{T}$ with variance $P_{\rm p}=P_\circ W_{\rm p}$, $x(\hat k)$ is the $\hat k${\it th} sample of the primary transmit signal, $s(\hat k)$ is the $\hat k${\it th} received sample of the primary signal at the SU and $\mathbb{H}(\cdot)$ is the test statistic of the energy detector.

The quality of the
sensing process outcome is determined by the probability of detection,
$P_{\rm D}$, and the probability of false alarm, $P_{\rm FA}$, which are defined as
the probabilities that the sensing algorithm (technique) detects a PU under hypotheses $\mathcal{H}_1$ and $\mathcal{H}_0$, respectively.

Using the central limit theorem (CLT), the test statistic $\mathbb{H}$ for
hypothesis $\mathcal{H}_\theta$, $\theta\in\{0,1\}$, can be approximated by Gaussian distributions \cite{liang2008sensing} with
parameters
\begin{equation}
\begin{split}

\Lambda_\theta&=\theta\alpha_{\rm p,s}P_{\rm p}+\mathcal{N}_{\rm p},\ \sigma_\theta=\frac{(\theta\alpha_{\rm p,s}P_{\rm p}+\mathcal{N}_{\rm p})^2}{F_{\rm s}\tau_{\rm s}}
\label{eq0}
     \end{split}
    \end{equation}
where $\Lambda_\theta$ and $\sigma_\theta$ denote the mean and the variance of the
Gaussian distribution for the hypothesis $\mathcal{H}_\theta$, where $\theta\in\{0,1\}$. Since $\alpha_{\rm p,s}$ is Exponentially distributed random variable with parameter $1/\sigma_{\rm p,s}$, the
probabilities $P_{\rm FA}$ and $P_{\rm D}$ can be written as

\begin{equation}
\begin{split}
P_{\rm D}&={\rm Pr}\{\mathbb{H}(s)>\epsilon|\mathcal{H}_1\}\\& \!=\!\frac{\exp(\frac{\mathcal{N}_{\rm p}}{\sigma_{\rm p,s}P_{\rm p}} )}{\sigma_{\rm p,s}P_{\rm p}}\int_{\mathcal{N}_{\rm p}}^\infty \mathcal{Q}(\!\sqrt{F_{\rm s}\tau_{\rm s}}[\!\frac{\epsilon}{\mathcal{Z}}\!-\!1]\!)\exp(\!-\frac{\mathcal{Z}}{\sigma_{\rm p,s}P_{\rm p}} \!) d\mathcal{Z}
\label{eq1}
   \end{split}
    \end{equation}
    \begin{equation}
\begin{split}
P_{\rm FA}&={\rm Pr}\{\mathbb{H}(s)>\epsilon|\mathcal{H}_0\}= \mathcal{Q}(\sqrt{F_{\rm s}\tau_{\rm s}}[\frac{\epsilon}{\mathcal{N}_{\rm p}}-1])
\label{eq2}
   \end{split}
    \end{equation}
    where $\exp(\cdot)$ denotes the exponential function, $\epsilon$ is the energy threshold and $\mathcal{Q}(\mathcal{Y})~=~\frac{1}{\sqrt{2\pi}}\int_\mathcal{Y}^\infty \exp(\!-z^2/2)dz$ is the $\mathcal{Q}$-function.

    For a targeted false alarm probability, $P_{\rm FA}$, the value of the threshold $\epsilon$ is given by
        \begin{equation}
\begin{split}
\epsilon={\mathcal{N}_{\rm p}}\Big(\frac{\mathcal{Q}^{-1}(P_{\rm FA})}{\sqrt{F_{\rm s}\tau_{\rm s}}}+1\Big)
\label{eq3}
   \end{split}
    \end{equation}
   Thus, for a targeted false alarm probability, $P_{\rm FA}$, the probability of misdetection is given by substituting Eqn. (\ref{eq3}) into Eqn. (\ref{eq1}). That is,

    \begin{equation}
\begin{split}
P_{\rm MD}&=1\!-\!\frac{1}{\sigma_{\rm p,s}P_{\rm p}}\exp(\frac{1}{\sigma_{\rm p,s}P_{\rm p}} \mathcal{N}_{\rm p})\\ \,\,\,\,\,\ &\times \int_{\mathcal{N}_{\rm p}}^\infty \mathcal{Q}\Biggr(\!\sqrt{F_{\rm s}\tau_{\rm s}}\Big(\!\frac{{\mathcal{N}_{\rm p}}\Big(\!\frac{\mathcal{Q}^{-\!1}(\!P_{\rm FA}\!)}{\sqrt{F_{\rm s}\tau_{\rm s}}}\!+\!1\!\Big)}{\mathcal{Z}}\!-\!1\Big)\!\Biggr)\exp(\!-\frac{\mathcal{Z}}{\sigma_{\rm p,s}P_{\rm p}} \!) d\mathcal{Z}
\label{eq5}
   \end{split}
    \end{equation}
    where $\mathcal{Q}^{-1}(\cdot)$ is the inverse of $\mathcal{Q}$-function.

    \section*{Appendix D}
In this Appendix, we compute the expected value of $R\!=\!\log_2(1+\alpha_{\rm s,sd}\gamma_{\rm s,sd})$. It can be shown that,
    \begin{equation}
\begin{split}
\mathcal{G}_{P_\circ}=&\frac{1}{\sigma_{\rm s,sd}}\int_{0}^{\infty} \log_2(1+\alpha_{\rm s,sd}\frac{P_\circ}{\mathcal{N}_\circ}) \exp(-\frac{\alpha_{\rm s,sd}}{\sigma_{\rm s,sd}})\ \ \ {d}\alpha_{\rm s,sd}\\&\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\ =\frac{1}{\ln(2)} \exp(\frac{1}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}}) \Gamma(0,\frac{1}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}})
    \end{split}
    \end{equation}
   where $\Gamma(.,.)$ is the upper incomplete Gamma function.
    \begin{proof}
    Let $\gamma_{\rm s,sd}=\frac{P_\circ}{\mathcal{N}_\circ}$. Integration by parts and rearranging the resultant, the expression is given by
        \begin{equation}
\begin{split}
\mathcal{G}_{P_\circ}&=-\int_{0}^{\infty} \log_2(1+\alpha_{\rm s,sd}\gamma_{\rm s,sd})\ \ d\exp(-\frac{\alpha_{\rm s,sd}}{\sigma_{\rm s,sd}})\\&\,\,\,\,\,\,\,\,\,\,\,\,\,\,\ =\underbrace{-\log_2(1+\alpha_{\rm s,sd}\gamma_{\rm s,sd}) \exp(-\frac{\alpha_{\rm s,sd}}{\sigma_{\rm s,sd}})\Biggr|_0^\infty}_{\rm zero}\\& \,\,\,\,\,\,\,\,\,\,\,\,\ +\frac{1}{\ln(2)}\int_{0}^{\infty}\exp(-\frac{\alpha_{\rm s,sd}}{\sigma_{\rm s,sd}}) \frac{\gamma_{\rm s,sd}}{1+\alpha_{\rm s,sd}\gamma_{\rm s,sd}} \ d\alpha_{\rm s,sd}
    \end{split}
    \end{equation}
    After removing the zero term, $\mathcal{G}_{P_\circ}$ becomes
            \begin{equation}
\begin{split}
\mathcal{G}_{P_\circ}=\frac{1}{\ln(2)}\int_{0}^{\infty}\exp(-\frac{\alpha_{\rm s,sd}}{\sigma_{\rm s,sd}}) \frac{\gamma_{\rm s,sd}}{1+\alpha_{\rm s,sd}\gamma_{\rm s,sd}} \ d\alpha_{\rm s,sd}
    \end{split}
    \end{equation}
     Letting $z=1+y$, $\mathcal{G}_{P_\circ}$ becomes
                 \begin{equation}
\begin{split}
\mathcal{G}_{P_\circ}&=\frac{1}{\ln(2)}\int_{0}^{\infty}\exp(-\frac{y}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}}) \frac{1}{1+y} dy\\& =\frac{1}{\ln(2)}\int_{1}^{\infty}\exp(-\frac{z-1}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}}) \frac{1}{z} dy\\& =\frac{1}{\ln(2)} \exp(\frac{1}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}})\int_{1}^{\infty}\exp(-\frac{z}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}}) \frac{1}{z} dz
    \end{split}
    \end{equation}
Letting $\frac{z}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}}=q$, we get
                 \begin{equation}
\begin{split}
\mathcal{G}_{P_\circ}&=\frac{1}{\ln(2)} \exp(\frac{1}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}})\int_{\frac{1}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}}}^{\infty}\exp(-q) \frac{1}{q} dq \\&= \frac{1}{\ln(2)} \exp(\frac{1}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}}) \Gamma(0,\frac{1}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}})
    \end{split}
    \end{equation}
where $\Gamma(.,.)$ is the upper incomplete Gamma function.
\end{proof}
   \section*{Acknowledgement}
   This paper was made possible by a NPRP grant 09-1168-2-455 from the
Qatar National Research Fund (a member of The Qatar Foundation). The
statements made herein are solely the responsibility of the authors.
\balance
\bibliographystyle{IEEEtran}
\bibliography{IEEEabrv,energy_bib}
\end{document}


TITLE: Hahn Banach. separate $A:=\{f \in L^2(-1,1): f \mathrm{\ is\ continuous}, f(0)=0\}$, $B:=\{f \in L^2(-1,1): f \mathrm{\ is\ continuous}, f(0)=1\}$
QUESTION [1 upvotes]: Consider $L^2(-1,1)$ and the sets $A, B$ defined as
$A:=\{f \in L^2(-1,1): f \mathrm{\ is\ continuous}, f(0)=0\}$, $B:=\{f \in L^2(-1,1): f \mathrm{\ is\ continuous}, f(0)=1\}$

Question: Does there exist an $\phi \in L^2(-1,1)'$  [that is the toplogical dual space of $L^2(-1,1)]$ such that $\phi(a)<\phi(b)\ \forall a \in A,\ b \in B$?

I want to use the following result:
$X...t.v.s., A, B \subseteq X$ disjoint, non empty, convex. $A$ open
$\Rightarrow \exists f \in X', \gamma \in \mathbb R: Re \ f(a) < \gamma \leq Re\ f(b)\ \forall a \in A, b \in B$
Now in our setting, $A, B$ are disjoint, non empty. Both are convex.

How can it be shown that $A$ is open?

REPLY [1 votes]: No such $\phi$ can exist, since $A$ and $B$ are dense in $X = L^2(-1, 1)$. As I pointed out in the comments, we have
$$f_n(x) = \max\{1 - n|x|, 0\} \to 0$$
as $n \to \infty$, since
\begin{align*}
\|f_n - 0\|^2 &= \int_{-1}^1f_n^2 \\
&= \int_{-1}^{-1/n} f_n^2 + \int_{-1/n}^0 f_n^2 + \int_0^{1/n} f_n^2 + \int_{1/n}^1 f_n^2 \\
&= \int_{-1}^{-1/n} 0 \, \mathrm{d}x + \int_{-1/n}^0 (1 + nx)^2 \, \mathrm{d}x + \int_0^{1/n} (1 - nx)^2 \, \mathrm{d}x + \int_{1/n}^1 0^2 \, \mathrm{d}x \\
&= \int_{-1/n}^0 (1 + 2nx + x^2) \, \mathrm{d}x + \int_0^{1/n} (1 - 2nx + x^2) \\
&= \left[x + nx^2 + \frac{x^3}{3}\right]_{-1/n}^0 + \left[x - nx^2 + \frac{x^3}{3}\right]^{1/n}_0 \\
&= \frac{2}{3n^3} \to 0.
\end{align*}
Note, in particular, that $f_n$ is a sequence of functions such that $f_n(0) = 1$, but $\|f_n\|$ can be arbitrarily small. As such, if we have an arbitrary $g \in X$, then we can always consider the sequence of functions
$$g_n = g - g(0) \cdot f_n.$$
Note that $g_n(0) = 0$, hence $g_n \in A$. However, since $f_n \to 0$, we have $g_n \to g$. This proves $A$ is dense. You can try something similar for $B$.
Now, suppose there is a continuous linear functional from $X$ to $\Bbb{R}$ such that $\phi(a) < \phi(b)$ for all $a \in A$ and $b \in B$. Let $r = \sup \phi(B)$. Then,
$$\phi(A) \subseteq (-\infty, \sup \phi(B)] \implies A \subseteq \phi^{-1}(-\infty, \sup \phi(B)].$$
The latter set is a proper, closed (recall $\phi$ is continuous) subset of $X$ that contains $A$, which contradicts $A$ being dense.


TITLE: A sequence of integral is uniformly bounded then this sequence is uniformly bounded
QUESTION [2 upvotes]: When I do my work, I come across a problem. Here is it.
Let $(f_n)_{n \in \mathbb{N}}$ be a sequence of measurable functions on a set $E$. Suppose there exists $M>0$ such that for all $n \in \mathbb{N}$, we have
$$\int_E |f_n| \le M.$$
My question is "Does this imply that the sequence $f_n$ is uniformly bounded on $E$, which means there exists some $C>0$ such that $|f_n| \le C$ on $E$"?
Any advice is highly appreciated.

REPLY [3 votes]: Take $E=(0,1), f_n=n\chi_{(0,\frac 1 n)}, M=1$.