► Problem 1 (TDS problem on Markov chains). Given a finite alphabet Σ⊆Z, a rational discount factor λ∈(0,1), a rational target t, and a finite Markov chain C with a designated initial state, rational transition probabilities, and transitions labeled by elements of Σ, compute the probability that (the sequence of labels along) a random infinite path from the initial state has discounted sum equal to t.
When 1/λ is an integer, Problem 1 can be solved effectively using known techniques: the target discounted-sum language L[Σ,λ,t]:={w∈Σω∣DSλ(w)=t} is recognized by an (effectively constructable) deterministic safety automaton [2], so it suffices to take the product of C with the automaton for L[Σ,λ,t] and compute the probability of the induced
Target Discounted Sum Problem on Markov Chains
safety property on the product Markov chain. This does not extend to arbitrary rational λ, since the language L[Σ,λ,t] is in general not ω-regular [2], and thus new ideas are needed. Our main result (Theorem 2) shows that Problem 1 is nevertheless solvable. More precisely, let μ=maxd∈Σ∣d∣, and let qλ and qt denote the denominators of λ and t, respectively, when written in lowest terms. The desired probability is rational and can be computed in time polynomial in the size of the Markov chain and in the numerical values of μ, qλ, and qt.
Our starting point is a notion of suffix sums, implicit in decidability proofs for special cases of the TDS problem [7]. The set of suffix sums of a sequence of numbers d0d1d2⋯ is {DSλ(didi+1⋯)∣i≥0}. We partition L[Σ,λ,t] into L[Σ,λ,t]<∞ and L[Σ,λ,t]∞, the sequences with finitely many distinct suffix sums form L[Σ,λ,t]<∞, and those with infinitely many form L[Σ,λ,t]∞. Our key technical result (Theorem 3) is that, in every finite Markov chain C, PrC(L[Σ,λ,t]∞)=0, that is, the probability of generating a path whose discounted sum equals t and that has infinitely many distinct suffix sums is zero. We then show (Theorem 4) that L[Σ,λ,t]<∞ is recognized by an effectively constructable deterministic safety automaton of pseudo-polynomial size. Theorem 2 then follows by Theorems 3 and 4, and the standard product construction [1].
Applications. We apply our techniques to Markov decision processes (MDPs) with the target discounted-sum objective (the objective of generating a path whose sequence of weights has discounted sum exactly t). In an MDP, non-deterministic choice of actions is resolved by a strategy, and fixing a strategy induces a Markov chain; we study the optimal (infimum and supremum) probability over all strategies of satisfying this objective, together with the existence and synthesis of optimal strategies.
For the infimum, we show that the optimal probability is rational and can be computed in pseudo-polynomial time. Furthermore, a deterministic finite-memory strategy achieving it always exists and can be synthesized in pseudo-polynomial time. For the supremum, computing the unrestricted optimal probability remains open. Indeed, this problem subsumes the TDS problem: a TDS instance can be represented as a one-state MDP with one deterministic self-loop action for each number in Σ, such that the supremum probability is 1 if and only if some sequence in Σω has discounted sum t. We therefore consider the supremum restricted to finite-memory strategies. We show that this value is rational, can be computed in pseudo-polynomial time, and is always attained by a deterministic finite-memory strategy, which can also be synthesized in pseudo-polynomial time. As a consequence, we obtain a memory dichotomy for the unrestricted problem: whenever an optimal strategy exists, either an optimal strategy with pseudo-polynomially bounded memory exists, or every optimal strategy requires infinite memory.
Related work. The Target Discounted Sum problem is studied in a paper by Boker, Henzinger and Otop [7], in which they solve it for the case when 1/λ is an integer. The case of arbitrary rational discount factor λ is left open. They relate the problem to β-expansions [14, 15]: with β=1/λ, a sequence with discounted sum t is a representation of t in base β over the digit set Σ. They also show that the constrained version, which given Σ⊂Z,λ∈Q, and t∈Q, asks whether there is an eventually periodic word w∈Σω with discounted sum t, is decidable. Their setting is non-stochastic, and so is the two-player generalization studied by Hunter and Raskin [9]. In that paper, they show how to solve games whose discounted-sum payoff must fall in a set defined as a union of intervals, without assuming 1/λ is an integer. However, they leave open the punctual case, where the objective is a single target value. Compared to these work, we study here stochastic variants, first on
Markov chains and then on MDPs (also called 121-player games).
The stochastic target discounted sum we study happens to be a special case of broader questions related to discounted-sum payoffs in stochastic models, for instance, multi-objective model checking [13, 8] and utility optimization [4]. Assuming a utility function that assigns 1 to the target and 0 to any other value, the probability computed for the target discount problem on such an instance coincides with the expected utility of the discounted-sum payoff. The optimization of such utilities, in the case when 1/λ is an integer, is performed in [4].
In the probabilistic setting, the closest to our work is the study of the distribution of a discounted sum whose weights are drawn independently; for ∣Σ∣=2 this is a Bernoulli convolution [10]. It has no atoms, that is, no value has positive probability, so a single target is hit with probability 0, and the questions studied there are about the whole distribution. In a Markov chain the weights along a path are not independent: the state reached after a prefix determines which letters may follow and with what probability, thus atoms can appear in Markov chains. We show that this probability is concentrated on the paths with finitely many distinct suffix sums.
Finally, discounted sum defines one of the standard value functions of quantitative automata [6, 5]. The safety automaton we define in our work builds on two quantitative automata families. On the one hand, comparator automata of Bansal, Chaudhuri and Vardi [3, 2], compare an aggregated value against a constant. On the other hand, categorizer automata [4], categorizes the discounted sum into one of finitely many bins. The two above-mentioned work require 1/λ to be an integer, and [4, Prop. 1] shows that this assumption cannot be dropped. In our results, we sidestep this assumption by building an automaton not for the whole target language L[Σ,λ,t] but for the sublanguage L[Σ,λ,t]≤∞, which by Theorem 3 has the same measure as L[Σ,λ,t] in every finite Markov chain.
2 Preliminaries
Words. Fix a finite alphabet Σ. A word (resp. finite word) is an infinite (resp. finite) sequence of symbols from Σ; we write Σω and Σ∗ for the sets of words and of finite words, ∣w∣ for the length of a finite word w, and ε for the empty word. Positions are numbered from 0, so that w=w[0]w[1]w[2]⋯, and we write w[0..i]:=w[0]⋯w[i] for a prefix, w[i..]:=w[i]w[i+1]⋯ for a suffix, and w⋅w′ for concatenation. We use the same position notation for the sequences of states introduced below.
Automata. A deterministic safety automaton is a tuple A=(Q,Σ,qinit,δ,F), where Q is a finite set of states, qinit∈Q is the initial state, δ:Q×Σ→Q is the transition function, and F⊆Q is the set of safe states. The run of A on a word w is the unique sequence ρ=q0q1⋯∈Qω with q0=qinit and qi+1=δ(qi,w[i]) for all i≥0; the automaton accepts w if qi∈F for all i≥0. We write L(A)⊆Σω for the set of accepted words by A, and ∣A∣:=∣Q∣ for the size of A. Every language of this form is ω-regular [1, Chap. 4].
Markov chains. We follow the standard terminology of [1, 12]. A Markov chain (MC) is a tuple C=(S,Σ,sinit,P,ℓ), where S is a countable set of states, sinit∈S is the initial state, P:S×S→[0,1]∩Q is a transition probability function satisfying ∑s′∈SP(s,s′)=1 for every s∈S, and ℓ:S×S→Σ labels transitions. The MC is finite if S is finite, in which case its size is ∣C∣:=∣S∣.
A path of C is an infinite sequence π=s0s1⋯∈Sω such that s0=sinit and P(si,si+1)>0 for every i≥0. A finite path is a finite prefix of a path. We write Paths(C) and Pathsfin(C)
Target Discounted Sum Problem on Markov Chains
for the sets of paths and of finite paths of C. The trace of a path π=s0s1⋯ is the word trace(π):=ℓ(s0,s1)ℓ(s1,s2)⋯, and the trace of a finite path πˉ=s0⋯sn is the finite word trace(πˉ):=ℓ(s0,s1)⋯ℓ(sn−1,sn) of length n. For s∈S, let Cs denote the MC obtained from C by replacing its initial state with s. Given a finite path πˉ=s0⋯sn of C and a path π of Csn, we write πˉ⊙π:=s0⋯sn−1⋅π for their concatenation, which is a path of C and satisfies trace(πˉ⊙π)=trace(πˉ)⋅trace(π). The cylinder set of a finite path πˉ is Cyl(πˉ):={π∈Paths(C)∣πˉ is a prefix of π}, and, with overloading notation, for πˉ=s0⋯sn denote P(πˉ):=∏i=0n−1P(si,si+1), where the empty product is 1. Every MC C induces a probability space (Paths(C),FC,PrC), where FC is the σ-algebra generated by the cylinder sets and PrC is the unique probability measure with PrC(Cyl(πˉ))=P(πˉ) for every πˉ∈Pathsfin(C). A language L⊆Σω is measurable if it is Borel for the usual topology on Σω; in which case, the event ELC:={π∈Paths(C)∣trace(π)∈L} belongs to FC for every MC C over Σ, and we write PrC(L):=PrC(ELC). Every ω-regular language is measurable [1, Chap. 10.3]. A set T⊆S is strongly connected if for all s,s′∈T there are t0,…,tn∈T with t0=s, tn=s′ and P(ti,ti+1)>0 for all 0≤i<n. A strongly connected component (SCC) is a maximal strongly connected set, and an SCC B is a bottom SCC (BSCC) if P(s,s′)=0 for all s∈B and s′∈/B. We write EBSCC(C) for the event consisting of all paths that enter some BSCC B. Following results can be found in [1].
► Proposition 1. Let C be a finite MC, let E∈FC, and let πˉ be a finite path of C ending in a state s. Then:
-
PrC(E∣Cyl(πˉ))=PrCs({π∈Paths(Cs)∣πˉ⊙π∈E});
-
if PrC(E)>0, then there is a path π∈E with PrC(E∣Cyl(π[0..n]))>0 for every n≥0;
-
PrC(EBSCC(C))=1.
3 The Target Discounted-Sum Problem on Markov Chains
In this section, we show that TDS problem on Markov chains (Problem 1) is solvable in pseudo-polynomial time. Recall that for a finite alphabet Σ⊂Z, discount factor λ∈(0,1) and target value t∈R, the target discounted-sum (TDS) language is L[Σ,λ,t]:={w∈Σω∣DSλ(w)=t}. In this section we prove following theorem.
► Theorem 2. Let Σ⊂Z be a finite alphabet, λ=p/q∈(0,1)∩Q a discount factor and t=a/b∈Q a target value, both in lowest terms, let μ=maxσ∈Σ∣σ∣, and let C be a finite Markov chain over Σ. Then PrC(L[Σ,λ,t]) is computable in time polynomial in ∣C∣⋅∣Σ∣⋅bq2μ.
To prove the result we partition the target discounted sum language L[Σ,λ,t] into two sub-languages L[Σ,λ,t]<∞ and L[Σ,λ,t]∞ according to the finiteness of the suffix sums:
L[Σ,λ,t]<∞:={w∈Σω∣DSλ(w)=t and {DSλ(w[i..∞])∣i≥0} is finite},
L[Σ,λ,t]∞:={w∈Σω∣DSλ(w)=t and {DSλ(w[i..∞])∣i≥0} is infinite}.
In Section 3.1 we prove Theorem 3, the main technical result of our work, which establishes a structural property of finite Markov chains, this result holds more generally for reals. In Section 3.2 we study the sub-languages L[Σ,λ,t]<∞ and L[Σ,λ,t]∞ and prove Theorem 4.
► Theorem 3. Let Σ⊂R be a finite alphabet, λ∈(0,1) a discount factor, and t∈R a target value. For every finite Markov chain C over alphabet Σ, probability PrC(L[Σ,λ,t]∞)=0.
► Theorem 4. Let Σ⊂Z be a finite alphabet, λ=p/q∈(0,1)∩Q a discount factor and t=a/b∈Q a target value, with a/b and p/q in lowest terms, and let μ=maxσ∈Σ∣σ∣. Then:
-
The language L[Σ,λ,t]≤∞ is recognized by a deterministic safety automaton A[Σ,λ,t] with O(bq2μ) states; moreover, A[Σ,λ,t] can be constructed in time O(bq2μ⋅∣Σ∣).
-
The language L[Σ,λ,t]∞ is ω-regular if and only if it is empty.
Thus the target discounted sum language L[Σ,λ,t] is ω-regular iff L[Σ,λ,t]=L[Σ,λ,t]≤∞.
Proof of Theorem 2. By Theorem 3 in finite Markov chain C, PrC(L[Σ,λ,t])=PrC(L[Σ,λ,t]≤∞). By Theorem 4 L[Σ,λ,t]≤∞ is recognized by deterministic safety automaton A[Σ,λ,t] of size O(bq2μ). It therefore suffices to compute PrC(L(A[Σ,λ,t])), which is standard and can be done by taking the synchronous product in time polynomial in ∣C∣⋅∣A[Σ,λ,t]∣ [1, Ch. 10].
3.1 Proof of Theorem 3
To prove Theorem 3, we first prove its statement for the case where C is strongly connected (Lemma 8 in Section 3.1). We then use Proposition 1 to generalize this result to arbitrary finite Markov chains. To prove the statement for strongly connected Markov chains, we prove that in a finite, strongly connected Markov chain C over alphabet Σ, the probability PrC(L[Σ,λ,t]) is either 0 or 1 (Lemma 5 in Section 3.1). We begin by introducing the necessary notation.
Notation and identities. Let Σ⊂R be a finite alphabet, λ∈(0,1) be a discount factor, and t∈R be a target value. Recall that for an infinite word w=d0d1⋯∈Σω, its discounted sum is DSλ(w)=∑i=0∞diλi. We overload this notation for finite words: for x=d0d1…dn∈Σ∗ DSλ(x)=∑i=0ndiλi. Observe that the following recursive property holds for every word w∈Σω and index n>0:
DSλ(w)=DSλ(w[0…n−1])+λnDSλ(w[n…∞]).(1)
Let C=(S,sinit,P,Σ,ℓ) be a finite Markov chain. Recall from Section 2 that for state s∈S, Cs=(S,s,P,Σ,ℓ) is the Markov chain starting at s. We write Prs as a shorthand for PrCs whenever the underlying Markov chain C is clear from context. Recall from Section 2 that if L⊆Σω is a language, the notation Prs(L) represents the probability of the event that a random infinite path in Cs has a trace in L. Consequently, conditional probabilities such as Prs(L∣E) or intersections like Prs(L∩E) refer to operations on the corresponding sets of paths in Cs, rather than on the language L itself. For a finite or infinite path π, we write DSλ(π) as a shorthand for DSλ(trace(π)). Let π^=s0s1…sn be a finite path in Cs. We also introduce the shorthands Lx and Lx∞ for the languages L[Σ,λ,x] and L[Σ,λ,x]∞, respectively, whenever Σ and λ are clear from context. By Proposition 1 and Equation (1), the language Lt satisfies
sPr(Lt∣cyl(π^))=snPr(Ltπ^),wheretπ^=(t−DSλ(π^))/λn.(2)
Analogously, consider the language Lt∞. The property of having infinitely many distinct suffix sums is a tail property. In other words, for every index n, an infinite word w∈Σω has infinitely many distinct suffix sums if and only if its suffix w[n…∞] also does. Therefore, we obtain
sPr(Lt∞∣cyl(π^))=snPr(Ltπ^),wheretπ^=(t−DSλ(π^))/λn.(3)
Results for strongly connected Markov chains. We now state a strong version of a 0-1 law for L[Σ,λ,t] in strongly connected Markov chains.
Target Discounted Sum Problem on Markov Chains
▶ Lemma 5. Let Σ⊂R be a finite alphabet, λ∈(0,1) a discount factor, and t∈R a target value. For every finite, strongly connected Markov chain C over alphabet Σ, either PrC(L[Σ,λ,t])=0, or every infinite path π in C satisfies DSλ(π)=t.
Proof. Let C=(S,sinit,P,Σ,ℓ) be a finite, strongly connected Markov chain. For a state s∈S, define the supremum ps∗=supx∈RPrs(Lx). We first prove that supremum ps∗ is attained; that is, there exists a vs∈R such that Prs(Lvs)=ps∗: If ps∗=0, then any target real number attains the supremum ps∗. If ps∗>0, then there exists a real number x0 such that Prs(Lx0)>0. Because the non-empty languages Lx and Ly are disjoint for every x=y∈R, the sum of probabilities Prs(Lx) over all x∈R sum to at most 1. Thus, at most Prs(Lx0)1 many real numbers x satisfy Prs(Lx)≥Prs(Lx0). Consequently, the supremum ps∗ is a maximum taken over a non empty finite set, and thus it is attained. Let vs∈R be such that
CsPr(Lvs)=ps∗.(4)
Define p∗=maxs∈Sps∗. We next show that for every state s∈S, ps∗=p∗. To do so, we establish the following claim:
▷ Claim 6. For every state s∈S and target number x∈R such that Prs(Lx)=p∗, for every finite path π^=s0s1…sn in Cs of length n+1≥0, we have \Pr_{s_n}(L_{x_\hat{\pi}}) = p^*, where xπ^=λnx−DSλ(π^).
Proof of claim. Fix an arbitrary path length n+1≥0. The law of total probability gives: Prs(Lx)=∑π^=s0s1…sn∈Pathfin(Cs)Prs(cyl(π^))⋅Prs(Lx∣cyl(π^)). Note that the sum is taken over only finite paths of length n+1. Substituting Equation (2), we obtain: Prs(Lx)=∑π^=s0s1…sn∈Pathfin(Cs)Prs(cyl(π^))⋅Prsn(Lxπ^). where xπ^ is as defined in the claim.
By definition of p∗, for every finite path π^ of length n+1, Prsn(Lxπ^)≤p∗. Because the cylinder probabilities Prs(cyl(π^)) are positive and sum to 1, the right-hand side of the above equation is a convex combination of terms bounded by p∗. Consequently, the assumption Prs(Lx)=p∗ implies that every term Prsn(Lxπ^) is equal to p∗.
▷ Claim 7. For every state s∈S, ps∗=p∗.
Proof of claim. Recall that p∗=maxs∈Sps∗. Let u∈S be a state such that pu∗=p∗. By (4), Pru(Lvu)=p∗. Because the Markov chain C is strongly connected, for every state s∈S there is a finite path in Cu of positive length ending at s. By the preceding claim, this path guarantees the existence of a target number x0∈R such that Prs(Lx0)=p∗.
We now prove the lemma. Let t∈R be such that PrC(L[Σ,λ,t])>0, or simply
sinitPr(Lt)>0.(5)
We wish to show that every infinite path π in C satisfies DSλ(π)=t. To do this we will show that every infinite path π in C satisfies DSλ(π)=vsinit. Since Prsinit(Lt)>0, this implies t=vsinit, which would conclude the proof.
Assume for contradiction that there exists an infinite path π0=s0s1… in C such that v′=DSλ(π0)=vsinit. For index n≥0, let yn:=DSλ(π0[n…∞]). The recursive property of discounted sums (Equation (1)) gives: yn=λnv′−DSλ(π0[0…n]). By Claim 7 and Equation (4) Prsinit(Lvsinit)=p∗, thus for the finite path π0[0…n] of Csinit, Claim 6 implies that for xn:=λnvsinit−DSλ(π0[0…n]), one has Prsn(Lxn)=p∗. By Equation (5), p∗>0. Hence, Prsn(Lxn)>0 and thus there exists an infinite path πn in Csn such that DSλ(πn)=xn. We derive a contradiction for sufficiently large n. Let dmin=mind∈Σd and dmax=maxd∈Σd. The absolute difference between the discounted sums of every two infinite paths in a Markov chain over alphabet Σ is bounded by: W=∑i=0∞λi(dmax−dmin)=1−λdmax−dmin. Thus for every n≥0, the definitions of πn,xn and yn guarantee
∣DSλ(πn)−DSλ(π0[n…∞])∣=∣xn−yn∣=λn∣vsinit−v′∣≤W(6)
Because 0<λ<1 and vsinit=v′, the sequence λn∣vsinit−v′∣ diverges as n→∞. Thus, there exists a sufficiently large positive integer n such that λn∣vsinit−v′∣>W, contradicting Equation (6). Therefore, our assumption that π0 exists is false, proving the lemma.
▶ Lemma 8. Let Σ⊂R be a finite alphabet, λ∈(0,1) a discount factor, and t∈R a target value. For every finite, strongly connected Markov chain C over alphabet Σ, PrC(L[Σ,λ,t]∞)=0.
Proof. Let C=(S,sinit,P,Σ,ℓ) be a finite, strongly connected Markov chain. Assume for contradiction that Prsinit(Lt∞)>0. By Proposition 1, there exists a path π=s0s1… in C such that trace(π)∈Lt∞ and for every n≥0, the conditional probability satisfies: PrC(Lt∞∣Cyl(π[0…n]))>0. Substituting Equation (3) gives: Prsn(Ltn∞)>0, where tn=λnt−DSλ(π[0…n]). Because Ltn∞⊆Ltn, it follows that for every n≥0:
snPr(Ltn)>0.(7)
Because C is strongly connected, the Markov chain Csn is also strongly connected. Thus, by Lemma 5, every path in Csn has discounted sum tn.
Since trace(π)∈Lt∞, by the recursive property of discounted sums (Equation (1)) observe that tn=DSλ(π[n…∞]) and hence {tn∣n≥0} is infinite. Because the sequence of states sn is drawn from the finite set S, while the set of values {tn∣n≥0} is infinite, the pigeonhole principle dictates that there exist indices k,m≥0 with k=m such that sk=sm but tk=tm. However, sk=sm implies that the Markov chains Csk and Csm are identical. Moreover, because C is strongly connected, Csk and Csm are also strongly connected. As established in Equation (7) both Prsk(Ltk)>0 and Prsm(Ltm)>0. By Lemma 5, all paths in this Markov chain must evaluate to a single, unique discounted sum, which forces tk=tm. This contradicts the choice of k and m, completing the proof.
Proof of Theorem 3. Using Lemma 8 we now prove Theorem 3. Let C=(S,sinit,P,Σ,ℓ) be a finite Markov chain. Assume for contradiction that Prsinit(Lt∞)>0. By Proposition 1, PrC(EBSCC(C))=1. Thus, Prsinit(Lt∞∩EBSCC(C))=Prsinit(Lt∞)>0. By Proposition 1, there exists a path π=s0s1…∈EBSCC(C) such that trace(π)∈Lt∞ and for every n≥0: Prsinit(Lt∞∩EBSCC(C)∣Cyl(π[0…n]))>0. Therefore Prsinit(Lt∞∣Cyl(π[0…n]))>0. Substituting Equation (3) gives:
snPr(Ltn∞)>0,wheretn=λnt−DSλ(π[0…n]).(8)
Because π∈EBSCC(C), the path eventually reaches a BSCC B, that is there exists an index m>0 such that sm∈B. However, this results in a contradiction. The Markov chain Csm induces the same probability space as the finite, strongly connected Markov chain C′=(B,sm,P′,Σ,ℓ), where P′ is the projection of P onto the domain B×B. Thus, Lemma 8 guarantees that PrCsm(Ltm∞)=PrC′(Ltm∞)=0. This contradicts Equation (8) for index m, completing the proof.
Target Discounted Sum Problem on Markov Chains
3.2 Proof of Theorem 4
In this section, we prove Theorem 4. To do this, we present a construction of a deterministic safety automaton A[Σ,λ,t] (Definition 10) and show in Lemma 11 that when Σ⊂Z is finite, λ∈(0,1)∩Q, and t∈Q, the language of A[Σ,λ,t] is equal to the language L[Σ,λ,t]<∞.
Let Σ⊂Z be a finite alphabet, λ∈(0,1)∩Q a discount factor, and t∈Q a target value. Intuitively, the states of the automaton A[Σ,λ,t] store, after reading a finite word d0d1…dn, the current required suffix-sum, i.e., the discounted sum that the remaining suffix dn+1dn+2… must have for the discounted sum of the entire word d0d1d2… to equal t. Formally, it stores a unique value q∈Q that satisfies t=∑i=0ndiλi+λn+1q. Thus locally, if the current required suffix sum is q, then after reading a symbol d∈Σ, the remaining suffix must have discounted sum q′ where q=d+λq′. For example, if λ=21 and t=2, then after reading the prefix 12, the automaton stores the value 0. Using required suffix-sums as automaton states has appeared before [2]. However, when the discount factor λ is a rational that is not an inverse integer, the set of required suffix-sums that an automaton may need to track is often infinite, preventing a finite-state construction [2]. We use finiteness condition in the definition of L[Σ,λ,t]<∞ to resolve this difficulty.
The following lemma establishes that only finitely many distinct suffix-sums are required after reading prefixes of words in L[Σ,λ,t]<∞. The proof of the lemma is provided in Appendix A and is an adoption of the denominator analysis of "gaps" in Boker et al. [7].
However, where Boker et al. utilize this analysis primarily as an intermediate step toward the decidability of the TDS problem in special cases, we recast these ideas into an automata-theoretic framework: formalize the language of finite suffix-sums and derive a finite set of explicit automaton states, enabling the construction of A[Σ,λ,t].
► Lemma 9 (Finiteness of Required Suffix-Sums). Let Σ⊂Z be a finite alphabet, λ∈(0,1)∩Q a discount factor, and t∈Q a target value. There exists a finite set Q[Σ,λ,t]⊂Q such that for every word w=d0d1⋯∈L[Σ,λ,t]<∞ and for all indices i≥0: DSλ(w[i…∞])∈Q[Σ,λ,t]. Specifically, let λ=qp and t=ba, in lowest terms, where p,q,b∈Z+ and a∈Z. Defining dmin=minΣ and dmax=maxΣ, the set Q[Σ,λ,t] is defined as
Q[Σ,λ,t]:={bpx∣x∈Z and 1−λdmin≤bpx≤1−λdmax}.
We now formalize the construction of automaton A[Σ,λ,t]. The state space of this A[Σ,λ,t] is Q[Σ,λ,t]∪{⊥}. Intuitively, a state in Q[Σ,λ,t] indicates the required suffix sum, whereas the state ⊥ indicates that the required suffix sum is outside the set Q[Σ,λ,t], for which the lemma guarantees that no suffix would realize a word in L[Σ,λ,t]<∞.
► Definition 10 (Deterministic Safety Automaton A[Σ,λ,t]). The deterministic safety automaton A[Σ,λ,t]:=(Q,Σ,δ,q0,F) where: the states Q=Q[Σ,λ,t]∪{⊥}; the initial state q0=t; the set of safe states F=Q[Σ,λ,t]; and the transition function δ:Q×Σ→Q is defined as follows. For d∈Σ, δ(⊥,d)=⊥ and for all z∈Q[Σ,λ,t]: δ(z,d) is equal to λz−d if λz−d∈Q[Σ,λ,t] and ⊥ otherwise.
The correctness of this construction, formalized below, is proved in Section A.
► Lemma 11 (Correctness). Let Σ⊂Z be a finite alphabet, λ∈(0,1)∩Q a discount factor, and t∈Q a target value. The language L(A[Σ,λ,t])=L[Σ,λ,t]<∞.
Proof of Theorem 4. The ω-regularity of language L[Σ,λ,t]<∞ follows from Lemma 11. In Section A we establish that the deterministic safety automaton A[Σ,λ,t] has a pseudo-polynomial size. We here show that L[Σ,λ,t]∞ is not ω-regular unless it is empty. Assume for the sake of contradiction that L[Σ,λ,t]∞ is non-empty and ω-regular. A fundamental property of ω-regular languages is that every non-empty ω-regular language contain at least one ultimately periodic word [11]. Thus, there exists a word w∈L[Σ,λ,t]∞ of the form w=uvω, where u∈Σ∗ and v∈Σ+. Since an ultimately periodic word has finitely many distinct suffixes, the set of suffix sums of w is finite, which contradicts the fact that w∈L[Σ,λ,t]∞.
4 Applications
In this section we apply Theorem 3 and Theorem 4 to algorithmic questions about target discounted-sum objectives in Markov decision processes.
Markov decision processes (MDPs). An MDP is a tuple M=(S,Σ,sinit,Act,P,ℓ), where S is a finite set of states, Σ is a finite alphabet, sinit∈S is the initial state, Act is a finite set of actions, P:S×Act×S→[0,1]∩Q is a transition function, and ℓ:S×Act→Σ is a labelling function. For every state s and action a we require ∑s′∈SP(s,a,s′)∈{0,1}; the action a is enabled at s if this sum equals 1, and we assume that every state has at least one enabled action. A history is a sequence h=s0a0s1⋯an−1sn with s0=sinit and P(si,ai,si+1)>0 for all 0≤i<n; we write HM for the set of histories. Writing Dist(Act) for the set of probability distributions over Act, a strategy is a function θ:HM→Dist(Act) with θ(h)(a)=0 whenever a is not enabled at the last state of h. Denote ΘM as the set of all strategies. A strategy has finite memory if it can be implemented by a finite-state machine (Q,qinit,δ,τ), where Q is a finite set of memory states, qinit∈Q is the initial memory state, δ:Q×Act×S→Q is the memory-update function, and τ:Q×S→Dist(Act) selects a distribution over the enabled actions; such a strategy uses memory of size ∣Q∣. We write ΘMFM for the set of finite-memory strategies [1, Def. 10.97].
Under a strategy θ, the MDP M induces a (possibly countably infinite) MC CM,θ over Σ [1, Def. 10.92]. If θ is finite memory, then CM,θ is finite. For a measurable language L⊆Σω denote VMθ(L):=PrCM,θ(L), and for opt∈{sup,inf} define VMopt(L):=optθ∈ΘMVMθ(L), and VMFM-opt(L):=optθ∈ΘMFMVMθ(L). A strategy θ∈ΘM is opt-optimal for L if VMθ(L)=VMopt(L), and θ∈ΘMFM is FM−opt-optimal for L if VMθ(L)=VMFM-opt(L).
Optimal values and strategies
We first prove Lemma 12, which relates the inf- and sup-optimal values of the objectives L[Σ,λ,t] and L[Σ,λ,t]≤∞.
► Lemma 12. Let Σ⊂Z be a finite alphabet, λ∈(0,1)∩Q a discount factor, t∈Q a target value, and M a finite Markov decision process over alphabet Σ, then:
VMinf(L[Σ,λ,t])=VMinf(L[Σ,λ,t]≤∞)andVMFM−sup(L[Σ,λ,t])=VMsup(L[Σ,λ,t]≤∞).
Proof. Let opt∈{sup,inf}. Since every finite-memory strategy α induces a finite Markov chain, Theorem 3 gives VMα(L[Σ,λ,t])=VMα(L[Σ,λ,t]≤∞) for every α∈ΘMFM. Hence
VMFM−opt(L[Σ,λ,t])=VMFM−opt(L[Σ,λ,t]≤∞)=VMopt(L[Σ,λ,t]≤∞).(9)
where the second equality follows from Theorem 4 and the standard result that finite-memory strategies suffice for ω-regular objectives in finite MDPs. For opt=sup, this gives the desired equality. For opt=inf, since L[Σ,λ,t]≤∞⊆L[Σ,λ,t], we have VMinf(L[Σ,λ,t]≤∞)≤VMinf(L[Σ,λ,t]). Moreover, since ΘMFM⊆ΘM, we have VMinf(L[Σ,λ,t])≤VMFM−inf(L[Σ,λ,t]). Together with (9), these inequalities yield VMinf(L[Σ,λ,t])=VMinf(L[Σ,λ,t]≤∞).
Target Discounted Sum Problem on Markov Chains
The following results follow by combining Lemma 12, Theorem 4, and standard results for safety objectives in finite MDPs [1]. In particular, L[Σ,λ,t]≤∞ admits a deterministic safety automaton of pseudo-polynomial size, allowing its optimal value to be computed and a deterministic finite-memory optimal strategy to be synthesized in pseudo-polynomial time. Lemma 12 then relates these values and strategies to the original target discounted-sum objective. See Section A for complete proofs.
► Theorem 13. Let Σ⊆Z be a finite alphabet, λ∈(0,1)∩Q a discount factor, t∈Q a target value, and M a finite Markov decision process over alphabet Σ. For the target discounted-sum objective L[Σ,λ,t]:
-
the inf-optimal value can be computed, and an inf-optimal deterministic strategy using pseudo-polynomial memory can be synthesized, both in pseudo-polynomial time;
-
the FM-sup-optimal value can be computed, and an FM-sup-optimal deterministic strategy using pseudo-polynomial memory can be synthesized, both in pseudo-polynomial time.
Theorem 13(2) yields a dichotomy for sup-optimal strategies (if they exists): either pseudo-polynomially bounded memory suffices, or infinite memory is necessary. We next show that the latter case does occur: there are finite MDPs in which a sup-optimal strategy exists, yet every such strategy needs infinite memory. The following proposition gives such an example, adapting the construction in the proof of [8, Proposition 1].
► Proposition 14. For Σ={0,1}, λ=32, and t=23, there exists a MDP M over alphabet Σ such that for target discounted sum objective L[Σ,λ,t], the sup-optimal strategy α∗∈ΘM exists and satisfies VMα∗(L[Σ,λ,t])>VMFM−sup(L[Σ,λ,t]).
Proof. Let Σ={0,1}, λ=32, and t=23. Let M=({s},s,Act,P,Σ,ℓ) be the single-state MDP with Act={act0,act1}, P(s,acti,s)=1, and ℓ(s,acti)=i for i∈{0,1}. By the proof of [8, Proposition 1], there is a word w∈Σω with DSλ(w)=3/2, but no eventually periodic word has discounted sum 3/2. Hence L[Σ,λ,t]=∅, while L[Σ,λ,t]≤∞ contains no eventually periodic word. By Theorem 4, L[Σ,λ,t]≤∞ is ω-regular. Since every non-empty ω-regular language contains an eventually periodic word, we obtain L[Σ,λ,t]≤∞=∅. Therefore, VMsup(L[Σ,λ,t]≤∞)=0, and Lemma 12 gives VMFM−sup(L[Σ,λ,t])=0. On the other hand, M has a path for every word in Σω. Choose w∈L[Σ,λ,t] and let α∗ deterministically follow the corresponding action sequence. Then w is generated with probability 1, and hence VMα∗(L[Σ,λ,t])=VMsup(L[Σ,λ,t])=1. Thus VMα∗(L[Σ,λ,t])>VMFM−sup(L[Σ,λ,t]), as required.
5 Conclusion
This paper introduces and solves stochastic variants of the target discounted-sum problem (TDS). We first showed that, in finite Markov chains, for every rational discount factor and every rational target t, the probability that a random path has discounted sum exactly t is rational and computable in pseudo-polynomial time. We then lift this computability result to MDPs, by showing that the infimum value and the finite-memory supremum value are computable in pseudo-polynomial time and are attained by deterministic finite-memory strategies.
Further extending our approach to stochastic games is an immediate follow-up research question. By Theorem 4, taking the product of our safety automaton with a game turns the language objective L[Σ,λ,t]≤∞ into a safety objective. This suggests that our results on MDPs carry over to turn-based stochastic games, where the value of the target discounted-sum objective would coincide with that of L[Σ,λ,t]≤∞ once the maximizing player is restricted to finite-memory strategies, while the minimizing player may use arbitrary strategies.
References
1 Christel Baier and Joost-Pieter Katoen. Principles of Model Checking (Representation and Mind Series). The MIT Press, 2008.
2 Suguman Bansal, Swarat Chaudhuri, and Moshe Vardi. Comparator automata in quantitative verification. Logical Methods in Computer Science, Volume 18, Issue 3, 07 2022. doi: 10.46298/lmcs-18(3:13)2022.
3 Suguman Bansal and Moshe Y. Vardi. Safety and co-safety comparator automata for discounted-sum inclusion. In CAV (1), volume 11561 of Lecture Notes in Computer Science, pages 60–78. Springer, 2019.
4 Nathalie Bertrand, Pranav Ghorpade, Senthil Rajasekaran, Sasha Rubin, and Moshe Vardi. Categorizer automata for discounted-sum payoffs, 2026. URL: https://arxiv.org/abs/2608.26763, arXiv:2608.26763.
5 Udi Boker and Guy Hefetz. Discounted-sum automata with multiple discount factors. Log. Methods Comput. Sci., 21(2), 2025.
6 Udi Boker and Thomas A. Henzinger. Exact and approximate determinization of discounted-sum automata. Log. Methods Comput. Sci., 10(1), 2014.
7 Udi Boker, Thomas A. Henzinger, and Jan Otop. The Target Discounted-Sum Problem. In 2015 30th Annual ACM/IEEE Symposium on Logic in Computer Science, pages 750–761, Kyoto, Japan, July 2015. IEEE. URL: http://ieeexplore.ieee.org/document/7174928/, doi:10.1109/LICS.2015.74.
8 Krishnendu Chatterjee, Vojtěch Forejt, and Dominik Wojtzczak. Multi-objective Discounted Reward Verification in Graphs and MDPs. In Ken McMillan, Aart Middeldorp, and Andrei Voronkov, editors, Logic for Programming, Artificial Intelligence, and Reasoning, pages 228–242, Berlin, Heidelberg, 2013. Springer Berlin Heidelberg.
9 Paul Hunter and Jean-François Raskin. Quantitative games with interval objectives. In FSTTCS, volume 29 of LIPIcs, pages 365–377. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2014.
10 Yuval Peres, Wilhelm Schlag, and Boris Solomyak. Sixty years of bernoulli convolutions. In Christoph Bandt, Siegfried Graf, and Martina Zähle, editors, Fractal Geometry and Stochastics II, pages 39–65, Basel, 2000. Birkhäuser Basel.
11 Dominique Perrin and Jean-Eric Pin. Infinite words - automata, semigroups, logic and games, volume 141 of Pure and applied mathematics series. Elsevier Morgan Kaufmann, 2004.
12 Martin L. Puterman. Markov Decision Processes: Discrete Stochastic Dynamic Programming. Wiley Series in Probability and Statistics. Wiley, 1994.
13 Mickael Randour, Jean-François Raskin, and Ocan Sankur. Percentile queries in multi-dimensional markov decision processes. Formal Methods Syst. Des., 50(2-3):207–248, 2017.
14 Alfréd Rényi. Representations for real numbers and their ergodic properties. Acta Mathematica Academiae Scientiarum Hungarica, 8:477–493, 1957. URL: https://api.semanticscholar.org/CorpusID:122635654.
15 K. Schmidt. On periodic expansions of pisot numbers and salem numbers. Bulletin of The London Mathematical Society, 12:269–278, 1980. URL: https://api.semanticscholar.org/CorpusID:123417265.
A Proofs
Proof of Lemma 9. Let w=d0d1⋯∈L[Σ,λ,t]<∞. By the definition of the language, DSλ(w)=t, and the set of suffix-sums S={DSλ(w[i..∞])∣i≥0} is finite. Assume without loss of generality that the discount factor λ=qp and the target t=ba are in lowest terms; that is, gcd(p,q)=1 and gcd(a,b)=1. Because the elements of Σ are bounded by dmin and dmax,
Target Discounted Sum Problem on Markov Chains
the inequality
1−λdmin≤DSλ(w[i..∞])≤1−λdmax
holds for all i≥0. Thus, to prove that DSλ(w[i..∞])∈Q[Σ,λ,t], it remains only to show that DSλ(w[i..∞]) can be written in the form bpx for some integer x. Since DSλ(w)=t and, for every i≥0, DSλ(w)=DSλ(w[0…i−1])+λiDSλ(w[i..∞]), the number DSλ(w[i..∞]) is a rational. Let DSλ(w[i..∞])=viui, where ui∈Z, vi∈Z+, and gcd(ui,vi)=1. We wish to show that for all i≥0, the denominator vi divides the product bp. For a prime number f and a non-zero integer n, let powf(n) denote the exponent of the highest power of f that divides n. Assume for contradiction that there exists some index k≥0 such that vk does not divide bp. This assumption implies that there exists a prime number f such that
powf(vk)>powf(bp).
Because the set of suffix-sums S is finite, the set of denominators {vi∣i≥0} must also be finite; therefore, the maximum value M=maxi≥0powf(vi) exists. By our assumption, M>powf(bp). Let k be the smallest index such that powf(vk)=M. We immediately observe that
powf(vk)=M>powf(bp)≥0.(10)
Moreover, because gcd(uk,vk)=1 and f divides vk (by the above equation), it follows that f does not divide uk.
powf(uk)=0.(11)
We analyze this situation using two exhaustive cases.
Case 1: The prime f divides p. We will derive a contradiction by proving that powf(vk+1)>powf(vk), which contradicts the choice of k.
Because DSλ(w[k..∞])=dk+λDSλ(w[k+1..∞]), rearranging the terms and substituting the fractional forms gives the equation
vk+1uk+1=pq(vkuk−dk)=pvkquk−qdkvk.
Let N=quk−qdkvk and D=pvk. The exponent of f in the reduced denominator vk+1 is given by the difference of the exponents in the unreduced fraction:
powf(vk+1)=powf(D)−powf(N).
Observe that
powf(D)=powf(p)+powf(vk).
Next, we show that powf(N)=0 by analyzing the exponents of the two terms in N. First, because gcd(p,q)=1, the assumption that f divides p implies that f does not divide q, that is, powf(q)=0. Thus together with Equation (11), we have powf(quk)=0. Second, we see that powf(qdkvk)>0 because powf(qdkvk)≥powf(vk) and powf(vk)>0 (Equation (10)). Because the two terms in N have distinct exponents of f, the exponent of their difference is the minimum of the two exponents:
powf(N)=powf(quk−qdkvk)=min{powf(quk),powf(qdkvk)}=0.
Substituting powf(D) and powf(N) into the equation for powf(vk+1) gives
powf(vk+1)=powf(D)−powf(N)=powf(p)+powf(vk).
Because f divides p, we know that powf(p)≥1. Hence, powf(vk+1)>powf(vk), which contradicts the maximality of M.
Case 2: The prime f does not divide p. We will derive a contradiction by showing that k≥1 and powf(vk−1)=powf(vk). This contradicts the assumption that k is the smallest index for which powf(vk)=M. We first show that M>powf(v0) to conclude that k≥1. Observe that v0u0=DSλ(w)=t=bα. Because both v0u0 and bα are in lowest terms, v0=b, therefore powf(v0)=powf(b). Moreover, M>powf(b) because M>powf(bp) (Equation (10)). Therefore, it follows that M>powf(v0). Next we show that powf(vk−1)=powf(vk). Because DSλ(w[k−1..∞])=dk−1+λDSλ(w[k..∞]), substituting the fractional forms gives the equation
vk−1uk−1=dk−1+qpvkuk=qvkqdk−1vk+puk.
Let N=qdk−1vk+puk and D=qvk. Then
powf(vk−1)=powf(D)−powf(N).
Observe that
powf(D)=powf(q)+powf(vk).
Next, we have powf(N)=0. This holds because powf(puk)=0 (since f does not divide p, that is powf(p)=0 and using Equation (11)) while powf(qdk−1vk)>0 (by Equation (10)). Substituting powf(D) and powf(N) into the equation for powf(vk−1) yields
powf(vk−1)=powf(D)−powf(N)=powf(q)+powf(vk).
Note that powf(vk−1)=M because powf(vk)=M, powf(vk−1)≤M, and powf(q)≥0. This contradicts the assumption that k is the smallest index for which powf(vk)=M.
Proof of Lemma 11. The direction L[Σ,λ,t]≤∞⊆L(A[Σ,λ,t]) is straightforward. For a word w=d0d1⋯∈L[Σ,λ,t]≤∞, the sequence q0,q1,… where qi=DSλ(w[i..∞]) is its unique run in A[Σ,λ,t] that avoids ⊥. Indeed, every qi∈Q[Σ,λ,t] (by Lemma 9), the initial state q0=t, and every pair of states satisfy the transition relation qi=di+λqi+1. We now show the other direction L(A[Σ,λ,t])⊆L[Σ,λ,t]≤∞. Let w=d0d1⋯∈L(A[Σ,λ,t]). Because A[Σ,λ,t] is a deterministic safety automaton with the set of safe states F=Q[Σ,λ,t], the unique run q0,q1,… of the automaton on w avoids the sink state ⊥. Thus, for all i≥0, we have qi∈Q[Σ,λ,t]. By the definition of the transition function δ, we have, for all i≥0: qi=di+λqi+1. By repeated substitution, this gives, for all n≥0:
qi=j=0∑ndi+jλj+λn+1qi+n+1.(12)
Since Q[Σ,λ,t] is a finite set, the values qi+n+1 are bounded. Thus, the reminder term λn+1qi+n+1 vanishes as n→∞. Furthermore, because rationals di+j belongs to Σ which is finite, the infinite series ∑j=0∞di+jλj converges. Taking the limit as n→∞ in Equation (12) therefore gives: qi=∑j=0∞di+jλj=DSλ(w[i…∞]). Since q0=t, it follows that the discounted sum DSλ(w)=t. Moreover because qi∈Q[Σ,λ,t] for all i≥0, and Q[Σ,λ,t] is finite, the set of all suffix-sums {DSλ(w[i..∞])∣i≥0} is also finite. Consequently, w∈L[Σ,λ,t]≤∞.
Target Discounted Sum Problem on Markov Chains
Proof of Theorem 4 (continued). We establish that the deterministic safety automaton A[Σ,λ,t] has a pseudo-polynomial size. Observe from Lemma 9 that the cardinality of the state space Q[Σ,λ,t]∪{⊥} of A[Σ,λ,t] is bounded by bp1−λdmax−dmin+1, where dmin=minΣ, dmax=maxΣ, and p,b∈Z+ such that λ=qp and t=ba for some q∈Z+ and a∈Z. Substituting the fractional forms of λ in the state space bound gives: bpqq−pdmax−dmin+1. Since λ∈(0,1), we have p<q. The above term is therefore strictly bounded by the worst-case scenario where p=q−1, which gives: b(q−1)q(dmax−dmin)+1. Consequently, the state space size is polynomial when b,q,dmax, and dmin are encoded in unary.
Proof of Theorem 13(1). By Lemma 12, the inf-optimal value
VMinf(L[Σ,λ,t])=VMinf(L[Σ,λ,t]<∞).(13)
Theorem 4 establishes that the language L[Σ,λ,t]<∞ is recognized by a deterministic safety automaton of pseudo-polynomial size. Hence, by standard product construction [1], for objective L[Σ,λ,t]<∞: (1) the inf-optimal value VMinf(L[Σ,λ,t]<∞) is computable in pseudo-polynomial time; and (2) a inf-optimal strategy α∗ that is deterministic and uses pseudo-polynomial memory can be synthesized in pseudo-polynomial time. Thus by Equation (13), VMinf(L[Σ,λ,t]) is computable in pseudo-polynomial time. We conclude the proof by showing α∗ is also inf-optimal for objective L[Σ,λ,t], that is, VMinf(L[Σ,λ,t])=VMα(L[Σ,λ,t]). First since α∗ is inf-optimal for objective L[Σ,λ,t]<∞ we have:
VMα∗(L[Σ,λ,t]<∞)=VMinf(L[Σ,λ,t]<∞).(14)
Next since α∗ is a finite-memory strategy, it induces a finite Markov chain. By Theorem 3 we have: VMα∗(L[Σ,λ,t]<∞)=VMα∗(L[Σ,λ,t]). Thus, together with equations 13 and 14, VMinf(L[Σ,λ,t])=VMα∗(L[Σ,λ,t]), which concludes the proof.
Proof of Theorem 13(2). By Lemma 12, the FM-sup-optimal value
VMFM−sup(L[Σ,λ,t])=VMsup(L[Σ,λ,t]<∞).(15)
Theorem 4 establishes that the language L[Σ,λ,t]<∞ is recognized by a deterministic safety automaton of pseudo-polynomial size. Hence, by standard product construction and the algorithms for solving safety objectives in MDP [1], for objective L[Σ,λ,t]<∞: (1) the sup-optimal value VMsup(L[Σ,λ,t]<∞) is computable in pseudo-polynomial time; and (2) a sup-optimal strategy α∗ that is deterministic and uses pseudo-polynomial memory can be synthesized in pseudo-polynomial time. Thus by Equation (15), VMFM−sup(L[Σ,λ,t]) is computable in pseudo-polynomial time. We conclude the proof by showing α∗ is also FM-sup-optimal for objective L[Σ,λ,t], that is, VMFM−sup(L[Σ,λ,t])=VMα∗(L[Σ,λ,t]).
First, since α∗ is a sup-optimal strategy for objective L[Σ,λ,t]<∞ we have:
VMα∗(L[Σ,λ,t]<∞)=VMsup(L[Σ,λ,t]<∞).(16)
Next, because α∗ is a finite-memory strategy we have:
VMα∗(L[Σ,λ,t])≤VMFM−sup(L[Σ,λ,t]).(17)
Finally, because L[Σ,λ,t]<∞ is a subset of L[Σ,λ,t], we have: VMα∗(L[Σ,λ,t]<∞)≤VMα∗(L[Σ,λ,t]). Thus, together with equations 15, 16, and 17, we have: VMFM−sup(L[Σ,λ,t])=VMα∗(L[Σ,λ,t]), which concludes the proof.