{'fraction_non_alphanumeric': 0.04593424626527841, 'fraction_numerical': 0.014754979628791309, 'mean_word_length': 4.245158418045559, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 48, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Two-Part Controller Synthesis Approach for Nonlinear Stochastic Systems Perturbed by L\'evy Noise Using Renewal Theory and HJB-Based Impulse Control

We are motivated by the lack of discussion surrounding methodological control design procedures for nonlinear shot and L\'evy noise stochastic systems to propose a hierarchical controller synthesis method with two parts. The first part is a primitive pattern-learning component which recognizes specific state sequences and stores in memory the corresponding control action that needs to be taken when the sequence has occurred. The second part is a modulation control component which computes the optimal control action for a pattern when it has occurred for the first time. Throughout our presentation of both components, we provide a self-contained discussion of theoretical concepts from Poisson processes theory, renewal theory, and impulse control, all of which are necessary as background. We demonstrate application of this controller to the simplified, concrete case studies of fault-tolerance and vehicle congestion control.


Introduction
The study of dynamical systems in the field of control theory utilizes mathematical models to describe the evolution of a certain set of system quantities over time. In its most abstract form, a dynamical system is traditionally written as the following ODE: where f : R + ×R n → R n is a deterministic function in C (1,2) , i.e., f is continuously-differentiable in time and twice continuously-differentiable in state, and the state dimension is n ∈ Z + . Core theoretical foundations for dynamical system models have been studied for decades and gathered in numerous comprehensive references such as [25,43,45,52] over time.
While much of basic control theory is studied under the condition that f in (1) is a deterministic function of t and x, many dynamical systems in practice are also affected by some amount of randomness, which prevents future states of the system from being able to be predicted precisely. These stochastic (dynamical) systems come in many different types and arise in a wide number of disciplines; some examples include voltage fluctuations in metallic conductors [5] in fields of physics, photon-counting in the field of optics [8], and the regulation of control circuits in biomolecular systems [34]. Motivated by the existence of these systems, there has been a vast literature of references, such as [32,36,23,24], dedicated to the rigorous study of stochastic systems and random processes.
When considering the problem of control or state-estimation for stochastic systems, many designs for controllers or observers, especially model-based designs, typically aim for robustness against specifically additive Gaussian white noise (AWGN). The model of such a stochastic system is expressed as the following SDE: where • W : R + → R d is a d-dimensional standard Brownian motion process.
There are many applications such as vision-based localization/mapping [51], spacecraft navigation [7], and motion-planning [21] where using Gaussian white noise processes in the model is justifiable in practice. From a theoretical perspective, Gaussian white noise processes are appealing to study because their convenient properties (e.g., continuity of sample paths, normality of the distribution, the Central Limit Theorem) make the stochastic system easier to analyze than non-Gaussian stochastic systems. Consequently, there is a wealth of literature that has been devoted towards analyzing the stability of systems with AWGN perturbations, and designing controllers and observers for them. Some classical model-based methods are the Linear Quadratic Gaussian (LQG) model [6,15], as well as Kalman filtering [22] and its extensions [39,48]. More recent methods of model-based controller and observer designs for Gaussian white noise include the path integral approach [46], convex optimization-based approaches [38,31], as well as a number of reinforcement learning based approaches [30,14].
However, there is a major lack of generality with the assumption of Gaussian white noise. Because it is small in magnitude and continuous in the sense that changes occur gradually over a measurable duration of time, it is unable to account for sudden impulsive perturbations. One particular class of non-Gaussian noise which is suitable for modeling impulsive perturbations is Poisson shot noise [3]. The dynamics of a stochastic system where shot noise is injected additively is written as the following SDE: where • N (dt, dz) is a r-dimensional standard Poisson process with some intensity λ ∈ R r .
• ξ : R + ×R n ×R → R n×r , ξ ∈ C (1,2,1) is a function which assigns weights to the individual components of N , since the standard Poisson process itself has unit weights. Essentially, ξ is a function that describes the impulsive jumps that occurs in the system.
Poisson shot noise arises in a wide diversity of real-world applications almost just as frequently as Gaussian white noise does. Some examples include the high fluctuations in stock prices within the field of finance [9], as well as the neuronal spikes that come from monitoring brain activity within the field of neuroscience [35] are better modeled as impulsive perturbations than as Gaussian noise. In applications of robotics, shot noise may arise in the the form of massive proprioceptive measurement errors, large disturbances due to obstacle collisions, or natural external factors in the environment such as a large gust of wind. Despite this prevalence, there are little to no analytical controller or observer synthesis procedures dedicated towards robustness against shot noise perturbations. In fact, for any non-Gaussian noise processes, machine-learning-based methods [17,44,47] are often the go-to methods used to learn the model from scratch, but a downside of these approaches are the massive amounts of time and training data they consume.
On the other hand, in the field of applied mathematics, there is an abundance of literature [1,33] which provides many theoretical results on Poisson random measures and jump-diffusion systems, which are relevant to addressing the controller and observer design procedures for shot-noise stochastic systems (3). A particularly useful theoretical result known as the Lévy-Khintchine Decomposition Theorem, stated formally in Theorem 1.6 of [50], Theorem 2.7 of [4], or Theorem 1.2.14 of [2], leads to a direct extension of (3) by uniting it with the Gaussian white noise case, yielding stochastic systems of the form: This affine decomposition of bounded-measure Lévy noise processes allows us to combine the controller and observer design procedures of (2) and (3) to obtain a design procedure for (4).
In this paper, we are motivated by two factors: 1. the lack of discussion surrounding methodological control synthesis procedures for stochastic systems involving shot and Lévy noise processes 2. the often inefficient way in which learning-based approaches are applied to any stochastic system perturbed by general non-Gaussian noise We take a step towards addressing both issues by proposing a hierarchical controller synthesis method composed of the following two parts: 1. a primitive pattern-learning component which recognizes specific state sequences and stores in memory the corresponding control action applied to the system when a sequence has occurred 2. a modulation control component which computes the control action to be taken when a specific state sequence is first encountered We note that in applications such as fault-tolerance, an independent lower-level controller can be used for the majority of the time, and the two-part controller is only applied when the system is destabilized. This requires some form of general stability analysis to determine a bound on when this two-part controller should be applied; in particular, we demonstrate how to determine this bound using the incremental stability analysis approach described in our previous paper [19]. Moreover, most traditional methodological control design approaches do not include the first part, and we motivate our choice of its inclusion in our proposed method as follows. In applications where the magnitude of the jumps in the impulsive part of the noise process can be grouped into discrete values, there is potential for the system to observe re-occurring sequences. Hence, there is no need to devote time and computational energy to redundantly compute a control action for a scenario that has been observed before. We leverage results from the well-known theory of renewal processes [40,41,10,11] and the problem of "pattern occurrence" to obtain criteria, such as the expected time that elapses between two consecutive instances of the same pattern, to aid in designing the learning component. We illustrate the proposed scheme using two particular case studies: 1. fault-tolerance control: we are inspired by fault-tolerance control applications such as spacecraft control [16,49,27] to investigate a simple system which uses the two-part controller as a means of fault-tolerance to steer the system back to some predetermined, certified safety bound; when the trajectory is already within the safety bound in the absence of the random jump disturbances, an independent lower-level controller is used for stabilization.
2. congestion control: the proposed two-part controller is used to optimally drive the state of the system towards increasingly lower energy states under a certain set of constraints. We consider the specific case study of controlling vehicle traffic at an intersection.

Paper Outline
We begin in Section 2 by laying out the renewal theory background relevant to the first part of the controller synthesis problem for shot noise stochstic systems (3) and Lévy noise stochastic systems (4). The subsection 2.2 then formally establishes the so-called pattern occurrence problem, which derives a way to compute the expected time between two consecutive occurrences of a specific pattern sequence in a string of renewals. Section 2.1 then provides an important unifying limiting theorem, called Blackwell's theorem, that is satisfied by all renewal processes and their corresponding extensions. Then Section 3 introduces the impulse control method to be employed in designing the actual action for the second part of the stochastic controller synthesis problem. We begin in Section 3.1 with a brief review of stochastic processes theory, the variations of Itô's formula, and the Poisson random measure in order to concretely establish the meaning and notation of the math we will be using for shot noise stochstic systems (3) and Lévy noise stochastic systems (4), since these concepts may be unfamiliar to the reader. We then introduce the specific type of control known as impulse control in Section 3.2, which will be used for the case studies of Section 4. Finally, in Section 4, we illustrate the control process on two sample case studies, the simple 1D linear stochastic process perturbed by Lévy noise, and the vehicle traffic at an intersection used to intuitively motivate our paper throughout the Introduction.

The Pattern-Learning Component
In this section, we discuss the first part of the controller synthesis procedure: the primitive learning component to recognize previously-occurred states so that the corresponding optimal control action can be recycled. To achieve this, we borrow elements from renewal theory, and in particular, the pattern occurrence problem to compute the expected time between consecutive patterns of renewals. Before we introduce the pattern occurrence problem in Section 2.2, we lay out some definitions and theoretical foundations at the core of renewal theory relevant for our discussion of stochastic control design in Section 2.1. Most of these definitions have been presented in standard random processes references such as [40] and [41], but we discuss them here to ensure that the material is self-contained. More importantly, the form of the theorems expressed in [40] or [41] are written for a general context, but we adapt the discussion for what is pertinent for the paper's proposed controller synthesis approach. For a more comprehensive treatment of our adapted discussion, we refer to our textbook preprint [18].

Basic Definitions and Results from Renewal Theory
Definition 1 (Counting Process). Suppose that we have a stochastic process {N (t), t ≥ 0} which satisfies the following conditions: • the process takes nonnegative, integer values: N (t) ≥ 0 and N (t) ∈ Z • the process is non-decreasing with respect to time: if s ≤ t then N (s) ≤ N (t) Then N (t) is referred to as a counting process.
Definition 2 (Renewal Process). Let {N (t), t ≥ 0} be a counting process and let A n := T n − T n−1 be the interarrival times, where T n denotes the time of the nth arrival time.
is a called a renewal process.

Note that
There are numerous extensions to renewal processes which can be made in order to model a broader class of real-world phenomena. To model aspects of our controller synthesis procedure, we look at three specific extensions: 1) renewal reward processes, 2) delayed renewal processes, and 3) regenerative reward processes. Analysis of these three types of renewal processes requires using the following well-known result.
< ∞ for all i, and let N be a stopping time such that E[N ] < ∞. Then the following equality holds: The proof of this elementary result is straightforward and has been deferred to [18] to keep the content of the paper focused. Instead, we present and prove a more crucial result which examines an important limiting property for renewal processes, namely its time-average renewal rate. We will see later in Blackwell's theorem the three corresponding extensions of the time-average renewal rate for each of the three types of renewal processes mentioned above.
Then the time-average renewal rate has the following limiting relationship: where m(t) := E[N (t)] is referred to as the mean process.
Proof of Theorem 1. We carry out this proof through two parts, we show that lim t→∞ Note that T N (t)+1 denotes the time of the first renewal after time t, which can alternatively be represented as where we refer to ∆T N (t) as the "excess" time from t until the next renewal.
By Wald's equation, note that which, in combination with (8), yields where the second equality follows from dividing through by tµ. Since ∆T N (t) ≥ 0, it follows that To prove the other half, suppose there exists a value C < ∞ such that P(A i < C) = 1. This implies that ∆T N (t) < C, and so (9) implies Thus, when the interarrival times are bounded, Theorem 1 holds. In the case where they are unbounded, again fix C > 0, and define {N C (t), t ≥ 0} to be the renewal process with interarrival times min(A n , C), n ≥ 1. Since min(A n , C) ≤ A n for all n ≥ 0, N C (t) ≥ N (t) for all t ≥ 0 since the interarrival times are shorter. Consequently: where the second equality follows from the first case, where the interarrival times are bounded. Since The two cases together, in combination with (10) yields the desired result (7).
Three natural extensions of renewal processes are described in the definition below.
1. Let {R n } ∞ n=1 be an iid sequences of random variables such that the nth renewal of N (t) obtains a reward of R n . Then N (t) is said to be a renewal reward process.
2. N (t) is said to be a delayed renewal process if the first interarrival time of the process is distributed differently from all future interarrival times.
3. N (t) is said to be a regenerative renewal process if there exist times {T at which the process restarts itself with probability 1, i.e., P(N (T (0) i )) = 1.
Renewal processes and their extensions from Definition 3 can be used to model elements of the case studies we investigate in Section 4. For instance, within the context of the congestion control problem, the cost that the system incurs by being at a certain level of congestion can be assigned a value using an appropriatelychosen reward function. In the vehicle traffic control problem, the reward of a vehicle could denote the inverse of the time spent waiting at the intersection before being allowed to pass. Regenerative renewal processes can be used to model the fault-tolerance control problem since the system effectively "restarts" from within the certified safety bound after the modulation control component corrects for the destabilizing pattern. Moreover, practical reasons for modeling systems using delayed renewal processes may be due to the system needing some additional time to warm up at the start. Now, we introduce an important unifying limiting theorem for the mean process of a renewal process over time, known as Blackwell's theorem, for different types of renewal processes. We can view Blackwell's theorem as a further development to the basic result described in Theorem 1. Several versions of Blackwell's theorem have been described in [40], [41], as well as in [42]. Section 4.4 of [10] and Chapter 9 of [11] further generalizes Blackwell's theorem and discusses some properties of renewal processes by invoking Laplace transforms. However, we emphasize that the version of Blackwell's theorem in this paper is specialized to make it easier to apply to the proposed controller synthesis framework, and also to the case studies that are addressed in Section 4. For an extensive treatment of Blackwell's theorem and the properties of renewal processes with the additional random processes background needed to facilitate their discussion, we refer to our textbook preprint [18].  The largest such c in which this property holds is referred to as the period of S.
We overload the terminology of "lattice" to describe both the random variable S and its distribution function F .

Definition 5 (Ladder Variables
). An ascending variable of ladder height S n occurs at time n if S n > max{0, S 1 , · · · , S n−1 }. Similarly, a descending variable of ladder height S n occurs at time n if S n < max{0, S 1 , · · · , S n−1 }. 1. If F is not lattice, then for all a ≥ 0.
2. If F is lattice with period c ≥ 0, then Note that N (nc) denotes the number of renewals which have occurred by time nc.
Proof of Theorem 2. We will only prove the nonlattice case of Blackwell's theorem statement, since the lattice case follows from a similar argument. For easier notation, let us denote g(a) := lim t→∞ (m(t + a) − m(t)). Then note that The form of g which satisfies this equation is given by g(a) = c · a, for some constant c. Now we want to show that c = 1/µ. Consider the following successive increments of a = 1: Note that lim n→∞ ∆m(n) = c.
On the other hand, by Theorem 1: Combining (15) together with (16), we have that c = 1/µ. This concludes the proof of the first part of the theorem.
Corollary 1 (Extensions to Blackwell's Theorem). There are also two straightforward extensions to Blackwell's theorem. The first is in the context of renewal reward processes. Suppose the renewal pro- Assuming the distribution of the cycle of a renewal reward process is not lattice, then where T is the length of a cycle of the renewal reward process.
The second extension is with respect to random walks, which are set up as follows. Let X 1 , X 2 , · · · be iid with mean µ := E[X] < ∞, and let S n := ∞ i=1 X i . Typically, the random walk S n is started at X 0 = S 0 = 0, and we assume this implicitly throughout unless stated otherwise. Denote If µ > 0 and X i are nonlattice, then Proof of Corollary 1. Next, for the extension of Blackwell's theorem pertaining to renewal reward processes, note that where the limit follows from (13).
Finally, to prove Blackwell's result pertaining to random walks, we define a renewal process using successive ascending ladder heights as the renewals, and denote Y (t) to be the excess height of the renewal process past height t > 0. Then S n = Y (t) + t is the first value of the random walk that exceeds t. See Figure 1 for visualization. Hence, the primary difference between Blackwell's Theorem for Random Walks and the original Blackwell's Theorem or Theorem 1 is that the renewal process has renewals which are dependent upon the previous renewals.
The proof of this theorem adheres very closely to the technique of the proof for the original Blackwell's theorem (13). Define Then we can show that h(a + b) = h(a) + h(b) using the same logic as in the proof of (13). The solution to such an equation is then given by h(a) = θa for some constant θ to be determined.
Let τ (t) := min{n|S n > t}. We look at two cases of X i , just as in the proof of (13).
On the other hand, if X i are unbounded, denote to be the number of times after exceeding c once S n lands in (−∞, t].
Then note that where the −1 comes from excluding the time S n exceeded t.
Note that given the value of If the first point of the random walk past c occurs at y + t, then the number of points in (t, t + a) has the same distribution as the number of points in (0, a) given the first positive value of the random walk occurs at y. Thus, if there is such an n where S n < S τ (0) , then the expected additional time m > 0 such that S n+m > 0 is finite since µ > 0. From time n + m, there is again a probability of 1 − p − S n+k > S τ (0) for all k > m. Thus: Finally, to conclude the result from both (19) and (21), note that u(1 + a) − u(a) → θ as a → ∞. This implies Indeed, θ = 1/µ and this concludes the proof. Now that we have discussed Theorem 1 and Blackwell's theorem, we are ready to consider some other important properties of reward, delayed, and regenerative renewal processes, i.e. the arrival time of the last renewal before a certain time, or the mean number of renewals that have arrived by a certain time. This requires a result related to taking the integral with respect to the mean process of the renewal process. Before we present the result, we define Riemann-integrable functions within the context of renewal theory.
where f n is the lower Riemann sum and f n is the upper Riemann sum. We say that f is Riemann-integrable if Furthermore, a sufficient condition for f to be Riemann integrable is that 1) In addition, let f : R + → R be a Riemann-integrable function. Then the following equality holds: where F n is the distribution of arrival time T n (which is the n-fold convolution of interarrival distribution F ), and F (t) := P(A i > t) for all i.
The importance of Theorem 3 arises in computing the limiting value of some probability or expectation-like function g(t) related to the renewal process. This yields an equation of the form for some Riemann-integrable function h. One specific function is the distribution of T N (t) , the arrival time of the last renewal before time t. Hence: Now we are ready to describe the properties of reward, delayed, and regenerative renewal processes, respectively.
Lemma 2 (Property of a Renewal Reward Process). Let N (t) be a renewal reward process with interarrival times {A n } ∞ n=1 and rewards {R n } ∞ n=1 . Moreover, let R(t) represent the total reward earned by time t: Then the following hold: Proof of Lemma 2. Since the proof of (23b) follows similarly to the proof of (23a), we will only prove (23a). Write: By the strong law of large numbers, ( (7). The combination yields (23a).

Lemma 3 (Properties of a Delayed Renewal Process). Consider a delayed renewal process {N
Then the following properties hold: • Denoting m D (t) := E[N D (t)] to be the mean number of renewals by time t: • Denoting H D (t) := t − T N D (t) to be the age of the process by time t, we have tG(t) → 0 as t → ∞ and Proof. First, by definition of expectation and utilizing the equivalence in (5): This proves (24).
Second, we first have by the dominated convergence theorem Note that because the mean of G is assumed to be finite, the integrand of (26) is finite. Hence, when taking t → ∞, the value of the overall integral tends to 0 since the upper and lower limits converge to the same value. Now we can consider the age of the delayed renewal process. By conditioning on the value of T N D (t) and substituting in (22) (and taking care to ensure that the distribution of the first interarrival time is given by G, not F ), we get since note that the age is simply the time elapsed since the last renewal. Now, note that under the assumption that G is finite, we showed above that tG(t) → 0 as t → ∞, which implies that the first term of (27) tends to 0. We will thus ignore the first term in our analysis and focus primarily on the second term. Using Theorem 3, we get: Note the relationship Substituting, we get: This proves (25). i ] < ∞ for all i. Then the following property holds: Proof. Conditioning on the time of the last cycle before time t, and using (22) yields: where m(t) := E[N (t)]. We've seen before that and hence: 1 > s)F (s)ds by Theorem 3 (31) and this proves the result since the integral denotes exactly the amount of time within a cycle A (0) the system spends in state i.

The Pattern Occurrence Problem
With the renewal theory background established, we now consider the general problem of pattern occurrence. We first discuss a couple motivational examples before describing a more general result.
Example 1 (Motivating Example: Expected Time). Suppose that we are observing a sequence of iid binary random variables X 1 , X 2 , · · · , each with distribution X i = 1 with probability p 0 with probability q := 1 − p Suppose we designate two strings A 1 and A 2 composed of 0's and 1's. One common problem of interest is the expected number of trials it takes to observe two consecutive instances of We choose for concreteness A 1 := (1, 0, 1, 0, · · · , 1, 0) to be the length-2n alternating sequence of 1 and 0, and A 2 := (1, · · · , 1, 0, · · · , 0) to be the length-m string of all 1's followed by the length-m string of all 0's.
We first compute E[T 1 ]. Note that if we were to treat each pair of (1, 0) as a single symbol, then we can view A 1 as a length-n string composed entirely of (1, 0) pairs. Clearly, the probability of observing exactly (1, 0) is pq. Hence, the number of trials required to observe (1, 0) for the first time after the last occurrence of A 1 is distributed according to a Geometric random variable with parameter pq. We can now iteratively derive the expression for the expected time it takes to obtain a new string of n pairs of (1, 0) after the last occurrence.
The expression (32) can also be directly derived using a system of linear equations. Denote E n,j to be the expected number of trials needed to observe n consecutive (1, 0)'s given j consecutive (1, 0)'s, where 0 ≤ j ≤ n, have already been observed. Further denote E (1) n,j to be the expected number of trials needed to observe n consecutive (1, 0)'s given j consecutive (1, 0)'s and an additional trial with outcome 1 have been observed. We now have n equations with these variables set up as follows: n,n−k = 1 + pE (1) n,0 + qE n,n−k+1 , ∀2 ≤ k ≤ n E n,n = 1 Solving this system and setting E[T 1 ] = E n,0 yields the same expression as in (32).
We compute E[T 2 ] using a similar approach. We must first observe the m consecutive 1's before considering the m consecutive 0's. Note that the probability of observing exactly m consecutive 1's is p m ; hence, the time it takes to observe m consecutive 1's is Geometrically distributed with parameter p m . Once m 1's have been observed, the time it takes to observe m consecutive 0's is also Geometrically distributed. Put together, the time to observe A 2 is Geometrically distributed with parameter p m q m .
The expression (33) can also be derived by solving a system of equations. Denote E k,i for 0 ≤ k ≤ m and i = 0, 1 to be the expected number of trials needed to observe the full A 2 given we have observed the subsequence of A 2 up to the kth outcome of i. Then: Solving this system and setting E[T 2 ] = E 0,1 yields the same expression as in (32). For further details on the derivation for both E[T 1 ] and E[T 2 ], see [18].
Example 2 (Motivating Example: Probability). Given a sequence of binary random variables X 1 , X 2 , · · · , another problem of interest is the probability of observing one subsequence before another. Let A 1 be a string of n 1's, A 2 be a string of m 0's, and A 3 be a string of r 2's, where n, m, r ∈ N + . Suppose the values of {X i } ∞ i=1 are generated in the following way. Until one of the two sequences A 1 or A 2 have been observed: If A 1 is observed first, the X i take the following distribution until either A 2 or A 3 is observed: Otherwise, if A 2 is observed first, the X i take the following distribution until either A 1 or A 3 is observed: Given this setup, we are interested in the probability P 1,3 that A 1 is observed before A 2 , and then A 3 is observed before A 2 . Denote E 1 to be the event that A 1 is observed before A 2 , and let P 1 := P(E 1 ). Further denote E 3 to be the event that A 3 is observed before A 2 given A 1 has been observed first, and let P 3 := P(E 3 ). Then by conditional probability, we can decompose the probability into two parts: Now P 1 and P 3 can then be computed independently. We first compute P 1 by conditioning on the outcome of the first trial X 1 . To that end, we denote S 1 to be the event that X 2 = · · · = X n = 1 and S 0 to be the event that X 2 = · · · = X m = 0. Thus: Note that P(E|X 1 = 1, S 1 ) = 1 and P(E|X 1 = 0, S 0 ) = 0. Furthermore, P(E|X 1 = 1, S c 1 ) = P(E|X 1 = 0) because S c 1 means that the outcome is 0 for one of the trials among X 2 , · · · , X n , after which we need to restart the count; the probability then becomes equivalent to P(E|X 1 = 0). Likewise, P(E|X 1 = 0, S c 0 ) = P(E|X 1 = 1). We then arrive at a system of two equations and two unknowns P(E|X 1 = 0) and P(E|X 1 = 1), which we can solve and substitute back into (34). We obtain an equivalent expression for P 3 via similar calculations. Hence: Now return back to the case from Example 1 where A 1 = (1, 0, 1, 0, · · · , 1, 0) with length 2n and A 2 = (1, · · · , 1, 0, · · · , 0) with length 2m. For the sake of simplicity, we will take the symmetric case of p = q = 1/2. Again define E to be the event where A 1 is observed before A 2 , and let P 1 := P(E). We can again compute P 1 by conditioning on the outcomes of trials, but in this case, both A 1 and A 2 start with 1. Thus, we instead condition on the outcome of the first two trials X 1 and X 2 . To that end, we denote S 1 to be the event that X 3 = 1, X 4 = 0, · · · = X 2n−1 = 1, X 2n = 0 and S 2 to be the event that X 3 = · · · = X m = 1, X m+1 = · · · = X 2m = 0. Thus: where P(E|X 1 = 0) = P(E) because neither A 1 nor A 2 start with 0.
Moreover, conditioning on S 1 and S 2 , we get the following respective equations: Altogether, we obtain a system of three equations with three unknowns. Substituting p = q = 1/2 and solving the linear system of equations for n = 5, m = 6 yields P 1,10 = 0.7895, P 1,11 = 0.7884, and P 1 = 0.7889. For further details, see [18].
The discussion of the simpler Example 1 and Example 2 segways naturally to more complicated pattern sequences and broader probability distributions of X i , i.e. those that take more than two values. The next theorem provides a result for when there is dependence among the values of X i .
Theorem 4 (Pattern Occurrence for Discrete-State Markov Chain). Let X 1 , X 2 , · · · denote a sequence of random variables taking values from a discrete-state Markov Chain with transition probability matrix P := {P ij } and stationary distribution {π k }. Let T denote the next time the pattern (x 1 , · · · , x m ) occurs after its first occurrence. Then: • When the pattern (x 1 , · · · , x m ) does not contain any overlaps. then the expected time T in between consecutive observations of the pattern is given by where µ(x, y) denotes the mean time it takes to reach state y in the Markov chain from state x.
• When the pattern (x 1 , · · · , x m ) has an overlap (x 1 , · · · , x k ) of size k, and (x 1 , · · · , x k ) itself does not contain any overlaps, then the expected time T in between consecutive observations is given by Example 3 (Theorem 4 for iid Sequence). We can specialize the results of Theorem 4 to the case where the random variables X i are iid. Let X 1 , X 2 , · · · denote a sequence of iid random variables taking on values from a discrete, finite set X . Denote p k := P(X i = k) for all i, and let T denote the next time the pattern (x 1 , · · · , x m ) occurs after its first occurrence. Then: • When the pattern (x 1 , · · · , x m ) does not contain any overlaps. then the expected time T in between consecutive observations of the pattern is given by • When the pattern (x 1 , · · · , x m ) has an overlap (x 1 , · · · , x k ) of size k, and (x 1 , · · · , x k ) itself does not contain any overlaps, then the expected time T in between consecutive observations is given by Note that computing the expected times to between consecutive instances of, respectively, the A 1 and A 2 used in Example 1, we obtain the exact same formulas (32) and (33) Specifically, A 2 does not have any overlaps, which is why E[T 2 ] can be derived using the formula (38); A 1 has overlapping patterns in the form of all length-2j subsequences of alternating (1, 0), for 1 ≤ j ≤ n − 1, and so E[T 1 ] can be derived using the formula (39).
Remark 1. Some of the standard references in renewal theory [40,41,42] also provide some discussion on the pattern-occurrence problem from renewal theory, but often only present the iid case of Example 3.
In Theorem 4, we extended this result to include a possible dependence structure for its relevance to the specific fault-tolerance and congestion control case studies we investigate later in Section 4. While a rough sketch of the proof for the iid case Example 3 can be found in [40], we provide a more detailed derivation of the formulas in our work [18]. The proof to Theorem 4 can also be found in [18].
Furthermore, we can address the question of comparing multiple different patterns at once. Let {A 1 , · · · , A M } for M ∈ N + be M different patterns of interest, and let T A i denote the time it takes to observe pattern A i . Denote T min := min{T A 1 , · · · , T A M } and denote P i to be the probability of observing pattern A i first at time T min . We further denote T A i |A j to be the additional time it takes to observe the pattern A i after A j has been observed. We are interested in computing the P i and E[T min ].
We further denote T A i |A j to be the additional time it takes to observe sequence A i given that we've already observed A j , for all i = j. Since all the patterns {A 1 , · · · , A M } are known, both E[T A i ] and E[T A i |A j ] can be computed using either Theorem 4 or Example 3. We can then derive a system of equations with these variables as follows: which, combined with the constraint that P M := 1 − i<M P i yields M linear equations with M unknowns P 1 , · · · , P M −1 , E[T min ]. For the case where M = 2, we obtain the explicit formula: In relation to Example 2, applying (40) to the case where A 1 is n consecutive 1's and A 2 is m consecutive 0's yields the desired result (35). Likewise, applying (40) to the case where A 1 := (1, 0, · · · , 1, 0) and A 2 := (1, · · · , 1, 0, · · · , 0) with n = 5, m = 6 implies that With p = q = 1/2, we obtain the numerical values derived at the end of Example 2.
Remark 2 (Alternative Pattern-Occurrence Problem with Random Walks). If we are interested in keeping track of longer pattern sequences of impulsive disturbances, the pattern-occurrence problem can also be solved using an alternative approach with random walks. Borrowing influence from common motivational problems such as the Gambler's Ruin problem, the theory of random walks can be used to determine the expected time it takes the system to reach certain boundaries imposed on the system state, upon which the modulation control mechanism takes over. For the sake of keeping this paper focused, we defer discussion of the connections between the pattern-occurrence problem and the theory of random walks to [18]. A comprehensive treatment of random walk theory background needed to understand these connections can also be found in [18].

The Modulation Control Component
In this section, we describe the second part of the controller synthesis procedure: the development of the actual control action to be taken when a specific state is first recognized by the first part learning component, especially during the event where a recognized pattern sequence of impulsive jumps causes the system to grow more and more unstable. This requires explicit formulation of the problem as an optimal control problem with corresponding performance objectives, and there is a wide diversity of modulation-type controllers that can be used in place of this second part depending on the kind of application considered. For the purposes of the specific fault-tolerance and congestion control applications that we investigate in the next Section 4, we introduce the impulse control method, which is a Hamilton-Jacobi-Bellman-based control for jump-diffusion processes that has been described in several references such as [33,13] and used for financial applications. Roughly speaking, the impulse control methodology forces the state of the system down to some safer, lower-energy state once it exceeds a prespecified limit determined by the first part of the hierarchical controller. This section adapts the general theory of the impulse control framework from [33,13] so that we can directly use it to the specific case examples to be studied in Section 4.

Stochastic Processes Review
The general Poisson random measure, typically denoted N (dt, dy) over the space [0, t] × E with "jump space" E, is characterized by the intensity measure Leb×ν, where Leb denotes the standard Lebesgue measure in time and ν(dy) is the probability measure on E describing the distribution of jumps. The formal definition of the Poisson random measure can be found in Theorem 2.3.5 in [1] or Definition 3.1 in [50], and other standard texts pertaining to Poisson processes.
A process L(t) is said to be a Lévy process if 1) all paths of L are right-continuous and left-limit (rcll), 2) P(L(0) = 0) = 1, and 3) L has stationary and independent increments [50,20]. This implies that both Gaussian white noise processes and compound Poisson processes are Lévy processes, and that the affine combination of the two, such as the process described in (4), is also a Lévy process. In fact, a well-known result called the Lévy-Khintchine Theorem, stated formally in Theorem 1.6 of [50], Theorem 2.7 of [4], or Theorem 1.2.14 of [2], says that Lévy measures can be represented as weak limits of the convolution of Brownian motion processes and Poisson random measures. This even includes the Lévy process whose intensity measure has unbounded jumps; one common example is a Gamma process, which has intensity measure on R + given by ν(dy) = ay −1 e −by dy such that on any finite interval of time, the number of jumps which lies in the interval (0, 1) is infinite. We do not consider such types of Lévy processes in this paper, since they rarely occur in the practical control and engineering applications of our target scope. Throughout this paper, we henceforth use the phrase "Lévy noise processes" specifically to refer only to the class of bounded-measure Lévy processes of the linear combination form in (4).

Lemma 5 (Itô's Formula for 1D Jump-Diffusion Processes). Consider the SDE
where X(t) ∈ R. Then for functions F ∈ C (1,2) , the derivative is given by where dX c (t) represents the continuous part of the SDE, and d[X, X] c (t) represents the continuous part of the quadratic variation.
Proof. We provide a proof of Itô's formula which is simpler than the version presented in [37]. Note that by integration-by-parts, where X(t) and Y (t) are two separate stochastic processes and subsequently, Recall the second-order Taylor expansion for F ∈ C 2 . We further assume x ≤ y: where the remainder term R(y, x) can be written as Now let P n := {0 =: T n 0 ≤ T n 1 ≤ · · · ≤ T n mn := t} be a partition of the time interval [0, t]. We can then write the difference as the sum We split the analysis into two cases • Continuous Case: When X(t) is the state of a SDE which only has continuous terms, we can use Taylor's formula to expand every term in the sum (43): and as n → ∞, i.e., as the interval size between partitions decreases to 0, With the terms all combined altogether which is indeed the Itô formula when the SDE contains only continuous terms.
• General Semimartingale Case: We split the intervals of the partition into two pieces: P + n is the subset of the subintervals over which the trajectory X(t) contains a jump of size at least 0 < ε << 1 and P − n := P n /P + n is the subset of subintervals over which the trajectory X(t) is completely continuous.

t. |X(s) − X(s−)| > ε}
Then we split the sum (43) into two parts: Note that as n → ∞, the second collective summation term can be reduced to the Continuous Case analyzed previously, with a superscript of c appended to the dX and d[X, X] terms to distinguish the continuous part from the discontinuous part. Furthermore, as n → ∞, the first collective sum converges as follows With all the terms combined together, we obtain the Itô formula described in (42). This concludes the proof.
We further define the compensated Poisson random measure asÑ (dt, dz) := N (dt, dz) − ν(dz)dt, where ν(dz)dt := E [N (dt, dz)]. We often care about the compensated Poisson random measure more than the original measure N because it is mean zero. For jump-diffusions of the form the Itô formula is written as follows Definition 8 (Infinitesimal Generator). For F ∈ C (1,2) , the infinitesimal generator is defined to be where E x [F (X(t))] denotes the expected value of F (X(t)) evaluated with initial condition X(0) = x.
From Itô's formula, we can determine the form of the infinitesimal generator for the SDE (41). Note that because the integral with respect to the white noise process W (t) and the integral with respect to the compensated Poisson processÑ are martingales Theorem 5 (Dynkin's Formula). For X(t) a trajectory of (41) and ϕ ∈ C 2 , the following equality holds: Lϕ(X(s))ds

The Impulse Control Method
Consider the following Lévy noise system, assuming the control input enters into the system additively An impulse control law is defined to be a sequence of intervention times and corresponding impulse heights u := (τ 1 , τ 2 , · · · ; z 1 , z 2 , · · · ) such that the closed-loop system state x u (t) abides by the following dynamics: As with many standard optimal control problems, we seek to find an optimal impulse control law which minimizes a certain cost. To this end, we denote the augmented state y(t) := (t, x(t)) T . Define the costto-go function (y) and the terminal cost g(y(t)). Further denote the cost of making an intervention with impulse z and state y as K(y, z). Then the overall performance objective to minimize is as follows: where τ S is the (possibly infinite) stopping time of the system and y is the initial state.
As is standard in many Hamilton-Jacobi optimal control approaches, the problem is posed as the following minimization scheme: we want to find Φ(y) and u * ∈ U such that A verification theorem provides for a tractable way to iteratively design such a u * with guaranteed optimality. A more general version of the verification theorem with certain continuity, differentiability, and convergence conditions imposed on any candidate value function ϕ : R + ×R n → R ≥0 such that ϕ(y) ≥ Φ(y) for all y is presented in [33,13], but it is too complex for the purposes of our controller synthesis procedure. Theorem 6 introduces a simplified version of the verification theorem. For the case studies we investigate in Section 4, any candidate value function that we consider immediately satisfies the continuity, differentiability, and convergence conditions imposed in the general statement from [33,13]; we thus remove explicit mention of these conditions. More importantly, Theorem 6 yields a variational inequality that is easier to solve. For simplicity of notation, the verification theorem is presented with the state space taken to be the real line ( = 1) with the notation Y (t) := y(t) and Y u (t) := y u (t), but extension to multiple dimensions is straightforward.
Proof. To prove part A, we recall Dynkin's formula from Theorem 5. Applying this formula to consecutive intervals [τ j , τ j+1 ) which each contain a single impulse jump yields: Fix a specific m ∈ N + . Then summing all equations of the above form from j = 0 to m gives By definition of M, we have and subtracting both sides by ϕ(Y u (τ j −)): Substituting the left side of (47) into (46) and multiplying the inequality throughout by −1: Lϕ(Y u (s))ds (48) Using the first condition, we have which transforms (48) to Taking m → ∞, i.e. t → τ S , and applying it to (49) gives and this proves part A of the theorem. To prove part B, we can simply repeat the proof of part A while replacing every inequality with an equality, which comes from the conditions of part B in the theorem's hypothesis.
Overall, the optimal value function Φ(y) should satisfy the following variational inequality for all y ∈ R.

max{Lϕ(y) + (y), ϕ(y) − Mϕ(y)} = 0
Further illustrative examples demonstrating how to apply the impulse control method for certain jumpdiffusion systems is presented in our textbook preprint [18]. For additional background on the connection between the impulse control approach and other standard Hamilton-Jacobi-Bellman optimal control methods, we refer the interested reader to [18].

Incremental Stability for Jump-Linear System
Now that we have established the relevant theory for the proposed two-part controller, we demonstrate its usage using shot-noise-modified extensions of two simple scalar systems which are commonly studied in the field of stochastic processes. In both examples, stability bounds are explicitly computed using the framework discussed in our first part of this paper [19], then used as the certified safety bound which determines the threshold at which the system transitions between two independent controllers. This hierarchical layering of controllers is motivated by spacecraft control applications [16,49,27], which manipulates the thrusters by switching between different flight control systems depending on factors such as how far away the system is from a desired trajecory or how close the system is to an impending meteorite strike. When the system remains within the safety region, a lower-level controller (e.g., a reference-tracking controller) drives the trajectory. Moreover, previous incremental stability results for deterministic [29] and Gaussian white noiseperturbed systems [12] show that such systems are guaranteed to remain within the safety region. Hence, for our systems of consideration, (3) and (4), the shot noise component of the noise process is arguably the main cause of destabilization in the system. Thus, when the system no longer remains within the safety region, the two-part controller is used to first identify the sequence of impulsive disturbances which caused the destabilization, then steer the trajectory back to within the safety region.
The first scalar system of our study is as follows. We assume the control input enters into the system additively. It can be viewed as the Ornstein-Uhlenbeck process [32] augmented with shot noise instead of the usual white noise: where a = 0, ξ > 0 are constants, and N (dt, dz) is a 1D Poisson random measure with rate λ > 0 and jump height distribution as a Bernoulli random variable which takes value η > 0 with probability p, and −η with probability q := 1 − p. As motivated above, we distinguish the control law into two parts where S ⊂ R defines the safety region computed from the bound of [19], u (t) describes the lower-level controller, and u tp (t) describes the two-part controller. For the purposes of keeping the discussion relevant to the paper, we focus on the degisn and impact of u tp (t) on the system and assume that u (t) is already given. One possible choice is a reference-tracking controller designed to track some reference trajectory x r (t): and gain k > |a|.
We now explicitly compute the form of the safety region S. The contraction metric M (t, x) is chosen to be the identity 1, meaning m = m = 1, and we have contraction rate α := |a|. We substitute only the lower-level controller u (t) into (50) for the computation of the stability bound, with the interpretation being that we want to determine the local extent of which the lower-level controller is able to handle the system.
A trajectory of the noiseless system is given by Taking the mean-squared difference between x(t) and y(t) yields: with steady-state error bound where c 0 > 0 is the length of the compact support of the probability distribution where the initial conditions x 0 , y 0 are drawn from, and the second inequality follows from the Cauchy-Schwarz Inequality. Note that the Poisson integrals in the two terms can be evaluated using Campbell's formula (presented in Section 3.2 of [26] and Proposition 2.7 of [28]) and the definition of the Poisson integral from Section 2.3.2 of [1]: and substituting back into (53) yields: We simulate (50) using the state-feedback lower-level controller to track the zero reference line (i.e., perform disturbance rejection), and visualize our results in Figure 2 for three values of λ ∈ {2, 1, 0.5}. For each λ value, we simulate three sample trajectories (in three different shades of gray) representing the mean- feasible for the shot noise perturbations to bring each trajectory outside of the safety envelope, upon which we allow the two-part controller to take over and steer the system back to within the envelope. Note that we achieve global exponential convergence for the system because of its simplified linear nature, so the lowerlevel controller manages to stabilize the system even while it is outside of the safety envelope by itself. However, we can still demonstrate the procedure of using the learning component of the two-part controller for determining re-ocurring jump patterns on this system; in our second example, we add Gaussian white noise to the dynamics so that the necessity of the two-part controller is more apparent.
We assume that a given specific pattern sequence of jump sizes leads to instability in the system. In this simple setup, the learning component approximates variations in the interarrival time between consecutive jumps using various zero paddings. What is the number of jumps T after which the exact pattern sequence of jumps will occur again? For concreteness, we focus on the specific pattern of (1, 2, 1) with M = 9. Then By symmetry of the problem, negative valued jumps should also be considered, i.e. (−1, −2, −1). In this case, we compute E[T ] by conditioning using the same methodology described in Section 2. Denote P A to be the probability that the string sequence A occurs before B. Then the renewal time in for some b > 0 to be determined.
The first condition of Theorem 6 states that the following expression needs to be zero for x ∈ [−b, b] in order for ϕ to be optimal: where Lϕ, i.e. dψ, was computed using Itô's formula. ψ must then satisfy the following differential equation: Again, we can solve this nonhomogeneous ordinary differential equation as a sum of homogeneous and nonhomogeneous parts. We guess the exponent of the homogeneous solution ψ h (x) := x r through the following auxiliary equation: and so (57) reduces to Solving this auxiliary equation yields one positive root r + and one negative root r − . Furthermore, the partial solution ψ p (x) corresponding to the nonhomogeneous part of the equation can be assumed to take on a form of a second-order polynomial A 2 x 2 + A 1 x + A 0 . Substitute ψ(x) = ψ h (x) + ψ p (x) into the original equation, then match the coefficients to determine the A i . Overall, when |x| ≤ b, the complete solution turns out to be Since we have symmetry of the problem in the sense that we desire to push the trajectory within an equidistant tube surrounding the zero line, we choose specifically C + = C − = −C, where C > 0, so that When |x| > b, we look at the second condition from Theorem 6. First, the intervention operator is written as: which implies that the minimizing value of z satisfies and so we want to find a > 0 such that −b < −a < 0 < a < b. Essentially, the impulse control law is designed to push the trajectory up (z > 0) to −a if it goes beneath level −b and push the trajectory down (z < 0) to a if it goes above level +b. This corresponds to the first-order conditions ψ (a) = −5 and ψ (−a) = 5.
With level a assigned, we explicitly choose the form of Thus, in combination, the form of ψ can be written as follows: Now, we can use the first-order conditions and the continuity and differentiability conditions to solve for a and C.
1. Continuity at x = b implies we need ψ(b−) = ψ(b+): =⇒ C(e r + b + e r − b ) + b 2 + 1 = C(e r + a + e r − a ) + a 2 + 1 + 5(b − a) 2. Differentiability condition at x = b implies we need ψ 1 (b) = ψ 2 (b+): 3. We also have the required condition that ψ (a) = ψ 1 (a) = −5 (and the opposite condition does not need to be mentioned due to symmetry): Cr + e r + a + Cr − e r − a + 2a = −5 See Figure 3 for a visualization of a sample trajectory for the system (56) with the impulse control law applied. Intuitively, it is easy to see that the impulse control method is optimal because it instantaneously pushes the state of the system down to a safer, lower-energy state. Furthermore, the nature of the control law is that this only happens once the trajectory exceeds a prespecified limit. We remark that the behavior of the trajectory illustrated in Figure 3 shows the ideal system response under no physical constraints on the system's components, e.g. its actuators. This is similar to the well-known bang-bang control action for spacecraft applications; while theoretically optimal, they are not always practical to implement. Similarly, in this setting, it may be difficult or most practical systems to perform a maneuver as sharp as an impulse control. However, we emphasize that the impulse control mechanism can be replaced with a synthesis procedure that incorporates physical constraints. The hierarchical nature of the two-part controller still remains the same, hence, the benefits arising from storing in memory control laws for future occurrences of destabilizing patterns which have been observed before are still present.

Controlling Vehicle Traffic at an Intersection
In this section, we demonstrate application of the two-part controller synthesis procedure on congestion control problems for discrete-valued quantities, such as the number of vehicles present in each lane of a stretch of road, or the number of packets in each flow that is queued up at an internet router. Particularly for congestion control problems, the discrete value of the state allows the learning component of the twopart procedure to identify recurring patterns much more accurately. For that reason, the pattern-occurrence problem is arguably better suited to congestion-type applications moreso than the scalar fault-tolerance control problem presented in the previous section. Another key distinction for how the two-part procedure treats congestion control-type problems is that the control action is applied as soon as possible in an effort to drive the level of congestion close to zero as quickly as possible, as opposed to the fault-tolerance control problems considered previously, which waits until an appropriate accumulation of impulsive disturbances has driven the trajectory beyond a nonzero bound.
For concreteness, we demonstrate this application to the specific congestion-type problem of controlling vehicle traffic across a single intersection by adjusting light signal patterns, and we look into two specific types of intersection scenarios: 1) the four-way intersection with one lane per road, and 2) the four-way intersection with one lane per road assuming the lanes on the opposite side of the intersection can be congested, and 3) the four-way intersection with two lanes per road, one for forward and right-turning traffic and one for left-turning traffic. For each of the scenarios, we look into how the learning component is designed by using the pattern-occurrence problem to compute the expected time that elapses between two consecutive instances of the same intersection state. First, we establish the general setting and the relevant simplifying assumptions for the problem. concreteness, we take x max = 5. One simplification we make is the discretization of time and the consequent representation of vehicle interarrival times as Geometric random variables instead of Exponential ones. This allows us to model the dynamics of the number of vehicles per lane of the intersection as a Markov chain. We denote p k to be the probability that k ∈ [1, x max ] vehicles enter into lane i within one timestep.
The intersection is locally controlled by traffic lights, one per lane, and each take on binary values depending on whether the light is green (1) or not (0). Suppose that the control law signal is such that the probability of the light being green at a certain time instance can be represented by a probability 0 < p G < 1 and let p R := 1 − p G be the probability that the light is red. This probability is what the second part of the two-part controller adjusts in order to optimize traffic flow, and we discuss this aspect in more detail later on. For simplicity, we assume that all vehicles travel at the same speed, and thus at a single timestep when the light is green, a constant number M < x max of vehicles can pass.
The learning component seeks to solve the following problem. Suppose that at time t, the state of the intersection is given by x 0 ∈ R n . We are interested in computing the expected number of timesteps after t in which the state x 0 occurs again. This is precisely the pattern-occurrence problem that we've studied in Section 2.2; in this setup, the renewals denote the event that the state of the intersection is x 0 . We are interested in this quantity for two complementary reasons. On one hand, it saves computational resources to have the system memorize the optimal traffic signal patterns for the first occurrence of x 0 , then apply it for every future occurrence of x 0 . On the other hand, if the system has limited memory storage and the time between consecutive occurrences of x 0 is too long, then the optimal control sequence may no longer be retained in memory, prompting recomputation from scratch anyway. We now address the pattern-occurrence problem for each of hte three cases described above.
One Lane per Road: Suppose there is one lane per direction, and vehicles in each lane are only allowed to pass the intersection by going straight forward. Then the dimension of the state is n = 4 and x := (x 1 , · · · , x 4 ) T ∈ R 4 . We order the counts of the lanes in the intersection as a vector according to (E, N, W, S). We further suppose that thhere is one designated traffic light assigned to each lane in each direction for a total of four lights, i.e. u := (u 1 , · · · , u 4 ) T ∈ {0, 1} 4 . However, certain constraints can be imposed on the four lights for basic efficiency, e.g. E and W traffic can pass simultaneously, and likewise for N and S traffic.
If we modeled the number of vehicles in each lane x , = 1, · · · , 4, as a Markov chain then we take the transition probabilities to be given by for all i ∈ Z ≥0 . Now suppose for concreteness, M = 2, x max = 5, and p G = 0.6, and suppose we are interested in the intersection snapshot x 0 := (5, 1, 5, 1) T . Enumerating all possible one-timestep previous states x 0 could have come from yields: 1. (y 1 , x 1 , y 2 , x 2 ) T where y 1 , y 2 ∈ {2, 3, 4, 5, 6, 7} and x 1 , x 2 ∈ {0, 1}, which reach x 0 in one step if the East and West lanes were given the green light at the same time some number of vehicles between five and zero entered the corresponding lanes, and if traffic in the North and South lanes were stopped at the same time one or no vehicles entered the correpsonding lanes.
2. (y 1 , x 1 , y 2 , x 2 ) T where y 1 , y 2 ∈ {0, 1, 2, 3, 4, 5} and x 1 , x 2 ∈ {0, 1, 2, 3}, which reach x 0 in one step if the East and West lanes were stopped at the same time some number of vehicles between five and zero entered the corresponding lanes, and if if traffic in the North and South lanes were given the green light at the same time three, two, one, or no vehicles entered the corresponding lanes.
Then the expected time in between consecutive instances of x 0 is given by 3,4,5,6,7} π (y 1 ,x 1 ,y 2 ,x 2 ) p y 1,5 p x 1,1 p y 2,5 p x 2,1 + x 1 ,x 2 ∈{0,1,2,3} y 1 ,y 2 ∈{0,1,2,3,4,5} π (y 1 ,x 1 ,y 2 ,x 2 ) p y 1,5 p x 1,1 p y 2,5 p x 2,1     π (y 1 ,x 1 ,y 2 ,x 2 ) p y 1,3 p x 1,3 p y 2,3 p x 2,3 + x 1 ,x 2 ∈{2,3,4,5} y 1 ,y 2 ∈{0,1,2,3} π (y 1 ,x 1 ,y 2 ,x 2 ) p y 1,3 p x 1,3 p y 2,3 p x 2,3 As in the coin tossing example of Section 2.2, we can set up the equations as follows. Note that there is no overlap between the two patterns, which implies T 1|2 = T 1 and T 2|1 = T 2 . Hence, where T 1 is from (62) and T 2 is from (63). One Lane per Road with Possible Jamming: Suppose now there is the possibility of a traffic jam on the opposite side of the intersection, which might prevent vehicles from being able to pass the intersection even on a green light. Note that if the rate of cars clearing the intersection on a green light without jams is given by M , the rate of cars leaving from the opposite side of the intersection and clearing space should also be M . Furthermore, since jams are most likely caused by adjacent intersections, we let p G be the probability that the vehicles in the jammed lanes begin to move, and p R is the probability that they remain in place, preventing cars on the incident side of the intersection from being able to cross.
The sole difference between including and excluding lane jams is the transition probability matrix. Essentially, vehicles can only cross an intersection when both lights are green, and can be stopped at an intersection if the opposite lane is blocked with other cars.
for all i ∈ Z ≥0 . We can then repeat the compuation shown in the previous scenario without lane jamming, with the appropriate Markov chain probabilities replaced.
Two Lanes per Road: Now suppose there are two lanes per road: one for forward and right-turning traffic, and one for left-turning traffic. The dimension of the state is now n = 8, x := (x 1 , · · · , x 8 ) T ∈ R 8 , and we order of the components in the vector is 'forward/right' first, 'left' second with the directions ordered counterclockwise from East to South. We again assume that there is one designated traffic light per lane u := (u 1 , · · · , u 8 ) T ∈ {0, 1} 8 , but impose certain common-sense constraints as in the previous one-lane case, i.e., vehicle streams passing in opposite directions (E and W , or N and S) can pass simultaneously. We also assume that the roads of the intersection are wide enough so that left-turning vehicles from opposite directions can also pass at the same time. For a visualization of the intersection, we refer to Figure 4.
A vehicle can either choose to turn left, right, or go straight forward with the following probabilities: 1. p L denotes the probability of vehicles which enter the left-turn lane among all the vehicles which enter the intersection from a neighboring intersection, and denote p F R := 1 − p L .
2. q F denotes the probability that vehicles in the forward/right-turning lane of an intersection go forwards, and q R := 1 − q F denotes the probability that a vehicle turns right.
For each of the four directions, we let p G,L be the probability that vehicles in left-turning lane are given the green light, p G,F R be the probability that vehicles in forward and right-turning lane are given the green light, and p R,L := 1 − p G,L , p R,F R := 1 − p G,F R . Additionally, since there are different distances that need to be crossed depending on whether a vehicle is turning left, right, or going forward, constant speed vehicles still take different amounts of time to cross the intersection. Thus, we also distinguish the constants M L < x max and M F R < x max .
Then the Markov chain probabilities for all four forward and right-turning lanes are different from the probabilities for all four left-turning lanes. Namely, for the number of vehicles in each forward and rightturning lane x , = 1, 3, 5, 7, the corresponding Markov chain transition probabilities are as follows: for all i ∈ Z ≥0 and for the number of vehicles in each left-turning lane x , = 2, 4, 6, 8, the corresponding transition probabilities are:

Conclusion
In this paper, we extended the study of stochastic control theory to include the class of Poisson shot noise by designing a two-part hierarchical control policy for systems of the form (3) and (4). The first part of the control policy invokes renewal theory to construct a learning component which recognizes previously-occurred states and their corresponding optimal control responses. Namely, we utilize the "pattern-occurrence" problem to determine the expected time between consecutive instances of the same state. Even incorporating this simple learning component into the system has the potential to save time and computational energy because there is no need to devote resources towards recomputing a control action for a state that has been observed before. The second part of the control policy invokes an impulse control approach which computes the actual control action which is optimal for each of the specific states kept track of by the first learning component part.
We then presented two simplified specific applications for control design: 1) a 1D fault-tolerance system and 2) a control problem for moderating vehicle traffic at an intersection. For the 1D fault-tolerance problem, we explicitly computed steady-state error bound κ s (β s , t) and showed that larger jump norm bounds η and 2) shorter interarrival times between jumps correspond to a larger error ball. We then used renewal theory to address the converse problem of determining the largest possible values of the shot noise characteristics, i.e. intensity and maximum absolute jump norm, such that the steady state error bound remains bounded by a desired tolerance. In this context, the renewals referred to the event where the trajectory exceeds the stability bound by an amount which makes the system unstable. The impulse control method is then applied at these points to navigate the trajectory back within the desired error bound.
For the vehicle traffic control problem, we used renewal theory to compute the expected time between consecutive renewals, which referred to certain snapshots of the intersection. The reason for saving these snapshots and their corresponding optimal control actions is to save resources. One might observe 10 cars in the East lane and five cars in the North lane, and the optimal control action might be to let the first five East cars pass, then the five North cars, and finally the last five East cars. If the system observes the exact same scenario in a future time, we simply recycle the same optimal control action used previously. We showed that renewal theory is also useful for choosing which states are worth saving in memory. For snapshots which do not have a high probability of occurring (e.g., ten vehicles occupying all four directions of the intersections simultaneouly), there is not much computational benefit to saving the corresponding optimal control action, especially when the system has limited storage. The performance objective for the impulse control method refers to the level of congestion in the intersection, and we desire to compute an action of traffic light sequences which minimizes the level of congestion as quickly as possible. Unlike the 1D reference-tracking problem, a necessary addition to the standard impulse control method is a time-varying performance criteria which assigns varying priorities to the lanes depending on the number of vehicles that are present at each lane.
We argue that the simplified examples investigated in this paper are sufficient enough to develop the theoretical framework for the controller synthesis procedure. To make the controller more applicable to more complex real-life instances, certain factors also need to be considered. One extension is towards the direction of continuous-valued jumps, which may be addressed by first discretizing the space of jumps: S := {ξ(t, x, z)| ξ(t, x, z) ≤ η} =⇒ S i := {ξ(t, x, z)| ξ(t, x, z) ≤ η i } for chosen threshold values 0 < η 1 < η 2 < · · · ≤ η k := η, where η is the upper bound on the norm of the jumps, and some k ∈ N. Then any two jumps ξ a (t, x, z), ξ b (t, x, z) which belong in the same set S i can be controlled using the same law. Another possible extension to the pattern occurrence problem is when we care about what specific order a certain number of patterns A 1 , · · · , A M occurs in. For example, for the case of M = 3, define T * to be the expected time until we see A 3 after we have already observed occurrences of A 1 , A 2 in any order. Then, with the notation P i being the probability of observing pattern A i first among all M patterns, we have The interest for looking into these types of pattern arrangements arises from applications in fault tolerance such as the turbulence of ocean waves affecting a drifting boat, or the collapse of the Tacoma Narrows Bridge in 1940. While these systems may have been designed to withstand strong perturbations, it may fail in events resulting from a steady accumulation of consecutive smaller perturbations. An extension for the modulation control component is the replacement of the impulse controller with an alternative controller, especially in applications where a sharp decay in the state is not physically feasible. The hierarchical structure of the two-part controller remains the same regardless: the learning component facilitates the recognition of destabilizing patterns, and the modulation controller is applied only then. One could also derive first-order conditions to impose additional limits on the extent of being able to control the system using impulsive jumps of large magnitude.