<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Batch Optimization for DNA Synthesis</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>11/01/2022</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10417397</idno>
					<idno type="doi">10.1109/TIT.2022.3184903</idno>
					<title level='j'>IEEE Transactions on Information Theory</title>
<idno>0018-9448</idno>
<biblScope unit="volume">68</biblScope>
<biblScope unit="issue">11</biblScope>					

					<author>Konstantin Makarychev</author><author>Miklos Z. Racz</author><author>Cyrus Rashtchian</author><author>Sergey Yekhanin</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Batch Optimization for DNA Synthesis Konstantin Makarychev, Mikl&#243;s Z. R&#225;cz , Cyrus Rashtchian , and Sergey Yekhanin Abstract-Large pools of synthetic DNA molecules have been recently used to reliably store significant volumes of digital data. While DNA as a storage medium has enormous potential because of its high storage density, its practical use is currently severely limited because of the high cost and low throughput of available DNA synthesis technologies. We study the role of batch optimization in reducing the cost of large scale DNA synthesis, which translates to the following algorithmic task. Given a large pool S of random quaternary strings of fixed length, partition S into batches in a way that minimizes the sum of the lengths of the shortest common supersequences across batches. We introduce two ideas for batch optimization that both improve (in different ways) upon a naive baseline: (1) using both (ACGT ) * and its reverse (TGCA) * as reference strands, and batching appropriately, and (2) batching via the quantiles of an appropriate ordering of the strands. We also prove asymptotically matching lower bounds on the cost of DNA synthesis, showing that one cannot improve upon these two ideas. Our results uncover a surprising separation between two cases that naturally arise in the context of DNA data storage: the asymptotic cost savings of batch optimization are significantly greater in the case where strings in S do not contain repeats of the same character (homopolymers), as compared to the case where strings in S are unconstrained.</p><p>Index Terms-DNA synthesis, DNA storage, shortest common supersequence, batch optimization.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>I. INTRODUCTION</head><p>S TORING digital data in synthetic DNA molecules has received much attention in the past decade <ref type="bibr">[1]</ref>- <ref type="bibr">[11]</ref>. DNA data storage offers several orders of magnitude higher information density compared to conventional storage media, as well as the potential to store data reliably for hundreds or thousands of years. However, the prohibitively high cost and low throughput of modern DNA synthesis technologies present a key barrier that needs to be addressed in order to make DNA data storage a commonplace technology.</p><p>For the purposes of the current paper we can think of a DNA molecule as a string (strand) in the quaternary alphabet {A, C, G, T }. Today the dominant method for producing large quantities of DNA molecules is array-based DNA synthesis <ref type="bibr">[12]</ref>, <ref type="bibr">[13]</ref>. With this technology the DNA synthesizer creates a large number of DNA strands in parallel, where each strand is grown by one DNA base (character) at a time. To append bases to strands, the synthesis machine follows a fixed supersequence of bases, called a reference strand. As the machine iterates through this supersequence, the next base is added to a select subset of the DNA strands. This process continues until the machine reaches the end of the supersequence. In particular, each synthesized DNA strand must be a subsequence of the reference strand. The cost of DNA synthesis is proportional to the length of the reference strand.</p><p>In applications to DNA data storage one typically needs to synthesize very large quantities of DNA molecules, significantly exceeding the capacity of any single DNA synthesizer. Therefore the pool of strands that one aims to synthesize needs to be partitioned into batches, where the size of each batch corresponds to the maximum load of the synthesizer. In this setting the total cost of DNA synthesis is proportional to the sum of the lengths of the shortest common supersequences of each batch. The focus of this paper is the algorithmic task of batch optimization, where the goal is to partition the strands into batches and assign every batch a reference strand in a way that minimizes this cost.</p><p>The encoding process that generates the list of DNA strands that need to be synthesized to store a given digital file varies with the specific system <ref type="bibr">[2]</ref>, <ref type="bibr">[5]</ref>, <ref type="bibr">[9]</ref>, <ref type="bibr">[14]</ref> and is usually quite complex. The encoder adds redundancy to the data to allow for the correction of various types of errors that occur during DNA synthesis, storage, and sequencing, including insertions, deletions, and substitutions of individual bases, as well as missing DNA strands.</p><p>We now describe two aspects of encoding of digital data in DNA that are relevant to our work. Commonly, input digital data is randomized <ref type="bibr">[9]</ref> using a seeded pseudorandom number generator or compressed and encrypted <ref type="bibr">[14]</ref>; this is done in order to reduce the frequency of undesirable patterns that may occur in strands that are used to represent the data, for instance, patterns likely to cause the presence of DNA secondary structure <ref type="bibr">[15]</ref>. Ensuring that strands look random also facilitates certain tasks that may be a part of the decoding process such as clustering <ref type="bibr">[9]</ref>, <ref type="bibr">[16]</ref> and trace reconstruction <ref type="bibr">[9]</ref>, <ref type="bibr">[17]</ref>- <ref type="bibr">[21]</ref>. Another important aspect is as follows. Algorithms that encode digital data in DNA <ref type="bibr">[3]</ref>, <ref type="bibr">[9]</ref> often ensure that the resulting strands do not contain long runs of the same character (i.e., homopolymers), since such runs are known to cause errors during the DNA sequencing stage. The length of the longest allowed homopolymer run may be as low as one-that is, not allowing homopolymersor unconstrained, depending on the scenario.</p><p>Motivated by the above considerations, in the current paper we model pools S of DNA strands that we aim to synthesise as large collections of random quaternary strings. We consider two key representative cases: the case where strings in S are unconstrained and the case where strings in S do not contain repeats of the same character.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Problem Statement</head><p>Fix a strand length n, and consider two different choices for the strand universe U.</p><p>1) Unconstrained strands: U = {A, C, G, T } n .</p><p>2) Strands without homopolymers: U is the subset of {A, C, G, T } n that contains all strands with no consecutively repeated characters. Let S be a subset of elements of U, with M := |S|;t h i si s the pool of strands we wish to synthesize. Let k be an integer that divides M, and let &#960; be a partition of S into k subsets (which we refer to as batches) B 1 ,...,B k of size M/k. 1 We define cost(B i ), the cost of synthesizing elements of the batch B i , as the length of the shortest common supersequence of all strands in B i . Using this notation, we define the cost of synthesizing the whole pool S as:</p><p>We assume that elements of S are selected i.i.d. from U uniformly at random, and we are interested in upper and lower bounds for cost(S) that hold with high probability.</p><p>While in the practice of DNA synthesis the parameters n, M ,a n dk are concrete numbers, to facilitate the asymptotic study of the problem we focus on the following relevant scenario: n is growing, M is significantly larger than but polynomial in n, and k is either a constant or a slowly growing function of n.</p><p>Example 1.1: Consider the setting of strands with no homopolymers. Let n =4and M =4. Let the set of strands to be synthesized be S = {AGCT,GCAT,CAGA,GAGC}. Assume that k =2 , that is, there are two batches and each batch contains two strands.</p><p>We can partition S into B 1 = {AGCT,GCAT} and B 2 = {CAGA,GAGC}. The DNA synthesizer (printer) first prints B 1 . It starts with two empty strings (&#8709;, &#8709;). Then, it appends A to the first strand and obtains strands (A, &#8709;). It appends G to both strands and obtains (AG, G). Then, it appends the letters C, A,a n dT as follows: 1 The assumption that the batches are of equal size is made for simplicity. Indeed, our techniques extend to a more general setting where the batches are roughly the same size (e.g., up to a constant factor), and several results are phrased in this more general setting.</p><p>After the last step, we get the set B 1 = {AGCT,GCAT}. The printer prints B 2 as follows:</p><p>In this example, we used the reference strand AGCAT to print the set B 1 in five steps and the reference strand CGAGAC to print the set B 2 in six steps. Therefore cost(S) &#8804; 11.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Main Results for Multiple Batches</head><p>Before describing our main results for multiple batches, we briefly and informally discuss the setting of a single batchformal statements and proofs are in Section III. A natural reference strand to use to print a pool of strands S is the periodic strand (ACGT ) * ,w h e r eACGT repeats indefinitely.</p><p>For this reference strand, the cost of printing a random strand can be written as n i=1 X i ,w h e r e{X i } n i=1 are i.i.d. uniformly random on {1, 2, 3, 4} in the case of unconstrained strands; in the case of strands without homopolymers, {X i } n i=1 are independent, with X 1 uniformly random on {1, 2, 3, 4} and X i uniformly random on {1, 2, 3} for i &#8805; 2. By using a standard concentration inequality we then obtain the upper bounds cost (S) &#8804; 2.5n +3</p><p>&#8730; n log M for unconstrained strands and cost (S) &#8804; 2n +3</p><p>&#8730; n log M for strands without homopolymers, with both bounds holding with probability 1o(1). Combining this with an appropriate stochastic domination argument that compares random walks, we also obtain matching lower bounds, for both choices of the strand universe U. This shows that for a single batch no reference strand can do asymptotically better than the periodic strand (ACGT ) * .</p><p>The setting of multiple batches, which is the focus of our work, presents interesting challenges. As a simple baseline, we could consider randomly partitioning S into k batches. A direct application of the single batch upper bound would provide a cost of roughly 2.5nk + O(k n log(M/k)) for unconstrained strands and 2nk + O(k n log(M/k)) for strands without homopolymers. We provide improvements in both cases by using a slightly more sophisticated batching method.</p><p>We first observe a symmetry property: For any strand without homopolymers the cost of printing it using (ACGT ) * and the cost of printing it using (TGCA) * add up to 4n +1, so the better choice of reference strand results in a cost of at most 2n. This idea can be extended to a large set of strands, by choosing for each strand the better reference strand out of (ACGT ) * and its reverse (TGCA) * .W efurther improve upon the cost by leveraging a second idea. After partitioning strands based on which of the two reference strands is better, we then sort the strands based on their cost (with respect to the chosen reference strand). We then use a quantile-based batching process to group the first M/k lowest cost strands, then the next M/k, etc. We show that combining these two ideas reduces the total cost to 2nk -&#920;(k &#8730; n) for k &#8805; 3 batches.</p><p>In the case of unrestricted strands, such an improvement is not possible, although we are able to show that with k batches a similar partitioning strategy, based on appropriately ordering the strands and using quantiles, enables us to save a factor of k in the deviation term and obtain a total cost of 2.5nk + O( &#8730; n log M ). We now formally state our results.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Theorem 1.2 (Upper Bounds):</head><p>Let S be a set of M random strands in {A, C, G, T } n ,a n dl e tk be an integer satisfying 3 &#8804; k &#8804; 1 4 M log M . There exist absolute constants C 1 &gt; 0 and C 2 &lt; &#8734; such that the following hold.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>1) (Strands Without Homopolymers):</head><p>There exists a way to efficiently partition S into k equal size batches B 1 ,...,B k such that with probability at least 1 -1/M we have that</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>2) (Unconstrained Strands):</head><p>There exists a way to efficiently partition S into k equal size batches B 1 ,...,B k such that with probability at least 1 -1/M we have that</p><p>We complement these results with almost tight lower bounds.</p><p>Proving the following theorem is the most technically challenging part of our work. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>1) (Strands Without Homopolymers):</head><p>There exists an absolute constant c 1 &lt; &#8734; such that the following holds with probability at least 1-c 1 /M . For any partition of S into k equal size batches B 1 ,...,B k ,w eh a v et h a t</p><p>2) (Unconstrained Strands): Suppose that M &#8804; exp(n).</p><p>There exists an absolute constant c 2 &gt; 0 such that the following holds with probability at least 1-c -1 2 /M .For any partition of S into k equal size batches B 1 ,...,B k , we have that</p><p>Comparing Theorems 1.2 and 1.3, we see that the upper and lower bounds match up to the absolute constants in the deviation term when k is small enough. As a consequence, this provides evidence that our batching method is nearly optimal, perhaps surprisingly.</p><p>Furthermore, Theorems 1.2 and 1.3 provide a clear separation between the two representative strand universes. On the one hand, for unconstrained strands we have, with probability 1o(1),t h a tcost(S)=2 .5nk +&#920; &#8730; n log M ;t h a ti s ,t h e cost exceeds the main term 2.5nk by the deviation term. On the other hand, for strands without homopolymers we have, with probability</p><p>&#8730; n; that is, the cost is smaller than the main term 2nk by the deviation term.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Related Work</head><p>For an overview of the biochemical DNA synthesis process, we refer the interested reader to the surveys <ref type="bibr">[10]</ref>, <ref type="bibr">[12]</ref>. Our work is motivated by several experimental papers that address the challenge of reducing the synthesis cost in both single and multi-batch settings <ref type="bibr">[22]</ref>- <ref type="bibr">[31]</ref>. Variants of the problem have also been studied that incorporate certain quality control measures <ref type="bibr">[32]</ref>- <ref type="bibr">[35]</ref>. Much of this previous work considers the (ACGT ) * supersequence when analyzing the synthesis cost. Rahmann first observed that in this case the single batch cost of uniformly random strings is approximately Gaussian, but he did not provide a formal analysis nor any asymptotic or finite-size bounds <ref type="bibr">[24]</ref>. In the multi-batch setting, previous work uses the same cost function as we do, namely the sum of the shortest common supersequence (SCS) lengths for each batch <ref type="bibr">[26]</ref>, <ref type="bibr">[30]</ref>. In general, a wide array of algorithms have been proposed and empirically evaluated for selecting a short reference string given the set of DNA strands to synthesize. However, these heuristics do not come with provable guarantees, and many of them implicitly solve the SCS problem, which is known to be NP-hard for a collection of strings <ref type="bibr">[36]</ref>, <ref type="bibr">[37]</ref>.</p><p>From a theoretical point of view, a few recent works have considered minimizing the synthesis cost through codingbased approaches. Lenz et al. study reference strings that have a large number of subsequences, and they consider mappings to encode data by a set of strings while minimizing the single-batch synthesis cost <ref type="bibr">[38]</ref>. A slightly different synthesis model has also been considered, where information is stored based on run-length patterns in the strings <ref type="bibr">[39]</ref>- <ref type="bibr">[41]</ref>. Our work also relates to combinatorial questions about the number of distinct subsequences <ref type="bibr">[42]</ref>- <ref type="bibr">[46]</ref>.</p><p>There is also a large body of prior work on the longest common subsequence (LCS) of random strings <ref type="bibr">[47]</ref>- <ref type="bibr">[53]</ref>. The expected LCS length of two random length n strings is known to be (&#947; + o(1))n for a value &#947;&gt;0 called the Chv&#225;tal-Sankoff constant. Despite decades of effort, the exact value of &#947; remains unknown for constant alphabet sizes. For two length n strings, the LCS and SCS are related via the equality SCS(S 1 ,S 2 )=2n -LCS(S 1 ,S 2 ), but for larger sets, no analogous relationship is known. In particular, our results show that the average SCS length for a large collection of strings behaves very differently than for a pair of strings. While we are not aware of prior results on the SCS for multiple batches, our single batch results improve an existing bound on the expected SCS length in the special case of M = n strings (see Remark 3.4).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D. Organization</head><p>The rest of the paper is organized as follows. We begin in Section II with a technical overview of our proofs. In Section III, we provide both upper and lower bounds for a single batch. In Section IV, we introduce the cost quantile preliminaries that we use for our multi-batch results. We prove the upper bounds for the multi-batch setting, Theorem 1.2, in Section V. Finally, we prove the lower bounds for the multi-batch setting, Theorem 1.3, in Section VI.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>II. PROOF OVERVIEW</head><p>In this section we give an overview of our results and the associated proofs. Suppose we want to synthesize a DNA strand S using a reference strand R. Denote the length of the prefix of R which we use for synthesis by cost R (S). Then, the cost of printing a batch of strands B using R equals the maximum cost of printing S for S &#8712;B:</p><p>We observe that the cost of printing any strand of length n using the periodic reference strand (ACGT ) * is at most 4n, since the i-th base of S can be printed using the corresponding base in the i-th quadruple of (ACGT ) * . Hence, the cost of synthesizing any batch of strands of length n is bounded from above by 4n. As we discuss later, the cost of every strand without homopolymers with respect to the reference strand (ACGT ) * is at most 3n +1 . So the cost of any batch of strands without homopolymers is also at most 3n +1.</p><p>Since the cost of synthesizing every batch of strands is upper bounded by 4n, we do not need to consider reference strands of length more than 4n. However, for the sake of analysis, we shall assume that all reference strands R have an infinite length. The first 4n bases of these strands are arbitrary, while the remaining infinite suffix is a repetition of the pattern ACGT . We denote the set of all such strands by R * . Observe that every strand S can be synthesized using every R &#8712;R * because R contains the substring (ACGT ) * .N o t e that when we synthesize a batch B using a reference strand R &#8712;R * , we truncate R after cost R (B) bases, so effectively we use a reference strand of length cost R (B).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Cost of a Single Batch</head><p>We first show how to estimate the cost of synthesizing a single batch of DNA strands. We prove that for a random strand S of length n and reference strand R =(ACGT ) * ,t he expected cost R (S) equals 2.5n. We then use concentration inequalities to argue that the maximum cost of strands in B is upper bounded by 2.5n + O( &#8730; n log M ) with high probability, where M is the batch size. Similarly, we show that for every fixed strand R,w eh a v et h a tE[cost R (S)] &#8805; 2.5n. Hence, for every fixed R the cost of B is also lower bounded by 2.5n +&#937;( &#8730; n log M ) with high probability. We obtain a lower bound on the cost of a batch by taking the union bound over all R &#8712;R * . Similarly, we get lower and upper bounds of 2n+&#937;( &#8730; n log M ) and 2n+O( &#8730; n log M ) for random strands without homopolymers.</p><p>We now discuss how to compute E[cost R (S)] for a given reference strand R and random S.L e t&#964; i (S, R) be the cost of the prefix S 1 ,...,S i .I no t h e rw o r d s ,&#964; i (S, R) is the index of t h eb a s ei nR that is used for synthesizing the i-th base in S. We let &#964; 0 (S, R)=0. Observe that {&#964; i (S, R)} i&#8805;0 is a Markov chain: the value of &#964; i+1 (S, R) depends only on the current state &#964; i (S, R) and the random value of S i+1 . We denote the increments of &#964; i (S, R) by X i (S, R):f o ri &#8712;{1,...,n},l e t</p><p>is a random variable uniformly distributed in {1, 2, 3, 4}, and all X i (S, R) are mutually independent. Consequently, E[X i (S, R)] = 2.5 for all i and thus E[cost R (S)] = 2.5n. Furthermore, by the central limit theorem, the deviation of the cost from its expectation, cost R (S) -2.5n, is approximately Gaussian with mean 0 and variance 1.25n. Thus, we can use Hoeffding's inequality and other concentration inequalities to obtain upper and lower bounds of on cost R (S). These bounds imply that the cost of a single batch of M strands equals 2.5n +&#920;( &#8730; n log M ). To show that E[X i (S, R)] &#8805; 2.5 for every R &#8712;R * and not only for R = R, we observe that the sequence of random variables</p><p>For random strands without homopolymers, each jump X i (S, R) is uniformly distributed in {1, 2, 3} for i&gt;1; and X 1 (S, R) is uniformly distributed in {1, 2, 3, 4}. Hence, the expected cost cost R (S) is 2n + 1 /2. Also, note that the maximum possible value of X i (S, R) is 3 (for i&gt;1). Hence, the cost of every strand is upper bounded by 3n +1.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Upper Bounds for Multiple Batches</head><p>We are going to use the same reference strand R = (ACGT ) * for synthesizing all batches of unconstrained strands and two different reference strands, R =( ACGT ) * and its reverse &#215; R =( TGCA) * , for synthesizing batches of strands without homopolymers.</p><p>1) Na&#239;ve Approach: Suppose we assign strands randomly to k batches. Then, each batch consists of M/k random strands sampled uniformly from {A, C, G, T } n . Hence, the cost of every batch is 2.5n +&#920;( &#8730; n log M ). Consequently, the total cost of synthesising k batches is 2.5nk + k &#8226; &#920;( &#8730; n log M ). We now show that by carefully assigning strands to batches we can improve this cost to 2.5nk +&#920;( &#8730; n log M ) for unconstrained strands. Similarly, we show how to improve a na&#239;ve</p><p>2) Unconstrained Strands: Our strategy for splitting the set of unconstrained strands S into k batches is quite simple. For every strand S in S, we compute cost R (S) a n dt h e ns o r t strands by this cost. We put the first M/k strands in the first batch, the second M/k strands in the second batch, and so on. Then, the cost of the i-th batch is equal to the empirical i /kth quantile of cost R (S) S&#8712;S . We formally define empirical quantiles in Section IV. In Section IV, we also show that, with high probability, empirical quantiles of cost R (S) S&#8712;S are very close to the corresponding quantiles of the distribution of the random variable cost R (S),w h e r eS is randomly and uniformly drawn from {A, C, G, T } n . The only exception is the empirical 1-quantile of the sample S which corresponds to the cost of the most expensive strand in S. This cost is approximately equal to the (1 -1 /M)-quantile of the distribution of cost R (S),w h e r eM is the size of S.</p><p>As we discussed above, cost R (S) can be approximated by the random variable 2.5n + g,w h e r eg is a Gaussian random variable with mean 0 and variance 1.25n. The sum of the 1/k, 2/k,...,(k -1)/k quantiles of a symmetric Gaussian distribution equals 0, since the quantiles i/k and (ki)/k are symmetric around 0.H o w e v e r ,t h e(1 -1 /M)-quantile of the distribution of g is relatively large and approximately equals c &#8730; n log M . Hence, the total cost of synthesizing k batches approximately equals</p><p>We make this argument formal in Section V.</p><p>3) Strands Without Homopolymers: If we use the same batching strategy as we discussed above for strands without homopolymers, we obtain a solution of cost 2nk + c &#8730; n log M with high probability. However, somewhat surprisingly, we can do better by utilizing two reference strands, R =( ACGT ) * and &#215; R =( TGCA) * , instead of just the single strand R. We show that the random variables cost R (S) and cost &#215; R (S) are anticorrelated. Specifically, for every strand S without homopolymers, we (deterministically) have</p><p>This observation suggests the following strategy: We first sort all strands S by their cost when printed with R.F o rt h e first dk/2e batches, we print them with R, and we print the remaining batches with &#215; R. Overall, we will argue that this batching process results in k -2 batches having a cost of at most 2n, and a constant fraction of these batches having an additional savings of &#937;( &#8730; n), which results in the ultimate</p><p>The only challenging batches are the "middle" two. We handle these by arguing that their costs are coupled so that together they do not exceed 4n +1.W en e x t explain the intuition behind the main savings. See Section V-A for full details of the batching process and the analysis.</p><p>Since (X i (S, R)+X i (S, &#215; R))/2=2for all i&gt;1 and S does not have homopolymers, the random variables cost R (S) and cost &#215; R (S) can be approximated by correlated random variables 2n-g and 2n+g,whereg is a Gaussian random variable with mean 0 and variance 2 /3 n. The cost of every strand is thus approximately equal to min{2n-g, 2n+g} =2n-|g|,andthe total cost of k batches is approximately equal to the sum of the i /k-quantiles of the random variable 2n -|g| for i =1,...,k. For sufficiently large k, this sum is approximately equal to</p><p>For small k (k&gt;2), the sum is upper bounded by 2nk -&#937;(k &#8730; n). We prove this bound for k &#8805; 3 in Section V-A.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Lower Bounds for Multiple Batches</head><p>We now discuss how to obtain lower bounds on the cost of batch synthesis. We start with lower bounds that are based on the following observation: Every batch B must contain a 1 /k fraction of all strands in S. Consequently, its cost is lower bounded by the empirical 1 /k-quantile of {cost R (S)} S&#8712;S , which, in turn, approximately equals the 1 /k-quantile of the distribution of the random variable cost R (S),w h e r eS is a random strand. Here R is the reference strand used for synthesising B. Using the notation (defined in Section IV) for empirical q-quantiles Q q,R (S) and q-quantiles Q q,R (D) of a distribution D, we can lower bound the cost of B as follows:</p><p>), where D1 /4 is the uniform distribution of strands of length n. Using Hoeffding's inequality for cost R (S) along with bounds on Q1 /k,R (S) and Q1 /k,R (D1 /4 ) from Section IV, we then show that </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>III. SINGLE BATCH ANALYSIS</head><p>As a warm-up to the multiple batch setting, in this section we analyze the single batch setting, that is, the setting where k =1 . As discussed in Section I-B, by using the periodic strand (ACGT ) * as a reference strand, we obtain (assuming M &#8805; n) the upper bounds cost (S) &#8804; 2.5n +3</p><p>&#8730; n log M for unconstrained strands and cost (S) &#8804; 2n +3</p><p>&#8730; n log M for strands without homopolymers, with both bounds holding with probability 1o(1). The formal statement and its short proof are in Section III-A.</p><p>We also obtain matching lower bounds, for both choices of the strand universe U, by an appropriate stochastic domination argument that compares random walks. The formal statements are in Section III-B and their proofs are in Section III-C. Proof: Consider first the case of unconstrained strands. We fix R := (ACGT ) * as the reference strand with which we print the strands in S.F o ras t r a n dS &#8712;U ,l e t&#964; i (S) denote the index of the base of R that is used to print the ith base of S. With this notation, R needs max S&#8712;S &#964; n (S) bases to print all strands in S. This shows that cost (S) &#8804; cost R (S)= max S&#8712;S &#964; n (S).L e t&#955; := 3</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Upper Bounds for a Single Batch</head><p>&#8730; n log M and m := 2.5n + &#955;. Combining the previous observation with a union bound we thus have that</p><p>The key observation is that if S is a uniformly random strand, then &#964; n (S) </p><p>Combining the two displays above we have that P {cost (S) &gt;m}&#8804;M/ (M ) 2 &#8804; 1/n, as desired.</p><p>The case of strands without homopolymers is analogous, the only change is that now {X i } n i=1 are independent random variables with X 1 uniformly random on {1, 2, 3, 4} and X i uniformly random on {1, 2, 3} for i &#8805; 2.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Lower Bounds for a Single Batch</head><p>The lower bounds for the two strand universes are analogous, but we state them separately for clarity. In both cases we present two bounds: one focusing on the constant of the linear term, with weak assumptions on M , the other focusing on the second order term, assuming slightly more about M .</p><p>1) Unconstrained Strands: Recall the upper bound of 2.5n+3</p><p>&#8730; n log M from Theorem 3.1 (assuming M &#8805; n). Our first lower bound result says that the constant 2.5 cannot be improved, even if the batch only consists of a (large enough) constant amount of strands.</p><p>Theorem 3.2: Consider the problem setup in Section I-A with k =1and unconstrained strands. Fix &#949;&gt;0 and let M &#8805; 21/&#949; 2 . Then, with probability at least 1exp (-n) we have that cost (S) &#8805; (2.5&#949;) n. This result can be significantly sharpened: if the number of strands in S is at least linear in n (and at most exponential in n), then not only is the main term 2.5n required in the cost, but even the additional &#8730; n log M term is necessary. Theorem 3.3: Consider the problem setup in Section I-A with k =1and unconstrained strands. Let M satisfy (5 exp <ref type="bibr">(45)</ref>) n &#8804; M &#8804; 5n exp (4n/25). Then, with probability at least 1exp (-n) we have that</p><p>Remark 3.4 (Expected Shortest Common Supersequence (SCS)): Since cost(S)=SCS(S), our results also provide bounds on the SCS of a set of strings. Jiang and Li consider the case when M = n, and they prove that E S [SCS(S)] = 2.5n &#177; O(n 0.707 ) for a set S of n uniformly random length n quaternary strings <ref type="bibr">[37,</ref><ref type="bibr">Corollary 4.11</ref> &#8730; n log M from Theorem 3.1 (assuming M &#8805; n). Our first lower bound result says that the constant 2 cannot be improved, even if the batch only consists of a (large enough) constant amount of strands.</p><p>Theorem 3.5: Consider the problem setup in Section I-A with k =1and strands without homopolymers. Fix &#949;&gt;0 and let M &#8805; 9/&#949; 2 . Then, with probability at least 1exp (-n) we have that cost (S) &#8805; (2&#949;) n. This result can be significantly sharpened: if the number of strands in S is at least linear in n (and at most exponential in n), then not only is the main term 2n required in the cost, but even the additional n log(M ) term is necessary. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Lower Bound Proofs for a Single Batch</head><p>We start with some definitions. Let &#931;:={A, C, G, T }.F o r two strands R, S &#8712; &#931; * ,l e tE R (S) denote the event that R is a superstring of S.L e tE R (S) denote the event that R is a superstring of all strands in S,thatis,E R (S):=&#8745; S&#8712;S E R (S). For an integer m,l e tE m (S) denote the event that there exists as t r a n dR &#8712; &#931; &#8804;m such that the event E R (S) holds. That is,</p><p>where the second equality holds because if R is a superstring of S, then all superstrings of R are also a superstring of S.</p><p>1) Proofs for Unconstrained Strands: Proof of Theorem 3.2: Fix m := (2.5&#949;) n.W es t a r t with a union bound:</p><p>where the equality is due to the fact that the strands in S are i.i.d. Our goal now is to bound P {E R (S)},w h e r eR &#8712; &#931; m is fixed and S &#8712; &#931; n is uniformly random.</p><p>To understand the probability of this event we introduce some notation. First, we extend the reference strand R indefinitely, by concatenating the strand (ACGT ) * to the end of R-this is done just so that everything in the following is well-defined-we refer to this extended strand as R .N o t e that R is a superstring of S, and the original reference strand R is a superstring of S if and only if the printing of S using R succeeds in at most m steps. Let &#964; i (S, R ) denote the index of the base of R that is used to print the ith base of S.W ea l s od e fi n eX 1 (S, R ): =&#964; 1 (S, R ),a n d X i (S, R ): =&#964; i (S, R )&#964; i-1 (S, R ) for i&gt;1. With this notation we have that</p><p>Let {Y i } n i=1 be i.i.d. random variables that are uniform on {1, 2, 3, 4}. Note that for an arbitrary R the random variables {X i (S, R )} n i=1 are not i.i.d.-in fact, they are not even necessarily independent. Specifically, given R and</p><p>However, no matter what, this support always consists of four distinct positive integers-the distances to the next occurrences of the four bases A, C, G,a n dT in R. Moreover, the distribution on this support is always uniform-this is because, given R and {X j (S, R )} i-1 j=1 ,t h ev a l u eo fX i (S, R ) is determined by S i , which is uniformly random on &#931;.S i n c e at best (in terms of minimization) the four distinct positive integers in the support of X i (S, R ) are 1, 2, 3,a n d4, the random variable X i (S, R ) stochastically dominates Y i . Moreover, since the bases {S i } n i=1 are independent, we also have that n i=1 X i (S, R ) stochastically dominates n i=1 Y i , and so we have that</p><p>We can now bound this latter quantity using standard estimates. In particular, using Hoeffding's inequality (Theorem 1.1) we obtain that</p><p>Plugging this back into (2) and (3), we have obtained the bound</p><p>If M &#8805; 21/&#949; 2 , then this is at most exp (-n).</p><p>Proof of Theorem 3.3: Let m := 2.5n + &#955;,w h e r e &#955; = 1 5 n log M 5n . The proof is identical to the proof of Theorem 3.2 until (3). At this point in the proof, we bound this probability differently. Specifically, by applying Lemma 1.3 with `=4,w eh a v et h a t</p><p>In order to obtain this bound via Lemma 1.3 we must have that (4/3) &#8730; n &#8804; &#955; &#8804; 2n/25; these inequalities hold due to the condition (5 exp <ref type="bibr">(45)</ref>) n &#8804; M &#8804; 5n exp (4n/25) assumed in Theorem 3.3. Note in particular that we thus have m &#8804; 2.58n. From (5) we thus have that</p><p>Plugging this into (2) and (3), we have obtained-analogously to (4)-the bound</p><p>2) Proofs for Strands Without Homopolymers: Proof of Theorem 3.5: The proof is almost identical to the proof of Theorem 3.2, so we only highlight the changes. First, we set m := (2&#949;) n. Second, {Y i } n i=1 are now i.i.d. random variables that are uniform on {1, 2, 3}. Thus Hoeffding's bound gives that</p><p>The rest of the proof is identical.</p><p>Proof of Theorem 3.6: Let m := 2n + &#955;,w h e r e&#955; = </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>IV. EMPIRICAL QUANTILES</head><p>Consider a distribution D on strands, and a reference strand R.F o rq &#8712; (0, 1),w ed e fi n et h eq-quantile of the distribution of the printing cost cost R (S),whereS is distributed according to D, as the minimum t such that P {cost R (S) &#8804; t}&#8805;q:</p><p>Similarly, for a set of strands S, we define an empirical variant of Q as:</p><p>For a family of reference strands R,w el e t</p><p>and</p><p>Consider a random set S D,M that contains M i.i.d. samples from the distribution D. By the Glivenko-Cantelli theorem, we have Q q,R (S D,M ) &#8776; Q q,R (D) for every R and a sufficiently large M . We use the Dvoretzky-Kiefer-Wolfowitz inequality to get a quantitative bound on Q q,R (S D,M ). Lemma 4.1: For every distribution D on strands, every reference strand R, and every positive &#949;,w eh a v e</p><p>Furthermore, for every family of reference strands R,weha ve</p><p>We prove this lemma in Appendix B.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>V. U PPER BOUNDS FOR MULTIPLE BATCHES</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Batching for Strands Without Homopolymers</head><p>Our approach is to define a quantile-based batching process and to then split the strands into two groups based on whether we use the reference strand R =( ACGT ) * or its reverse &#215; R =(TGCA) * . We first observe that one of these two options will lead to a cost of at most 2n if the strand does not contain homopolymers (and this result holds deterministically).</p><p>Lemma 5.1: Let R =( ACGT ) * and &#215; R =( TGCA) * be the alternating sequence and its reverse. For a strand S &#8712; {A, C, G, T } n without homopolymers, we have that</p><p>Moreover, there exists a bijection &#981; : {A, C, G, T } n &#8594; {A, C, G, T } n such that for every strand S &#8712;{ A, C, G, T } n we have that cost R (S)+cost R (&#981;(S)) = 4n +1.</p><p>Proof: Let &#964; i (S, R) and &#964; i (S, &#215; R) be the time that the i th character of S is printed using R or &#215; R, respectively. Consider the per-character costs X i (S, R)=&#964; i (S, R)&#964; i-1 (S, R) and</p><p>We now map every strand S to its compliment by replacing each base A with T , C with G, G with C,a n dT with A.</p><p>Observe that if we renamed each base as above both in S and the reference strand R, then the cost would not change. That is, cost R (S)=cost &#215; R (&#981;(S)). Using (8) we thus obtain <ref type="bibr">(9)</ref>. The key ideas in the following proof are to (i) use a quantile-based batching process to group the strands, and then (ii) decide whether they will be printed with R or &#215; R to reduce the overall cost. By using the above lemma, we know that for strands that have cost larger than 2n under R, they will have cost at most 2n under &#215; R. Using this and properties of the batching process construction, we argue that for k -2 of the batches the cost is at most 2n, with a constant fraction of these batches having cost at most 2n -&#937;( &#8730; n).F o rt h e two "middle" batches, we only show that the sum of their c o s t si sa tm o s t4n +1. Overall, we achieve a total cost of 2nk -&#937;(k &#8730; n) when summing over the k batches.</p><p>Proof of Theorem 1.2(1): For the proof, we assume that k divides M ; otherwise, we could set the batches to have size within M/k &#177; 1.L e tD denote the uniform distribution of length n strands without homopolymers.</p><p>We start by defining the batching process and the assignment of reference strands (i.e., choosing between R and &#215; R for each batch). To group the strands, we first sort the strands in S in a nondecreasing order according to their cost with respect to R. Then, we let B i be the subset of strands placed between positions (i -1)M/k +1 and iM/k (inclusive) in the ordering (e.g., B 1 contains the M/k lowest cost strands). After the batches have been defined, we use R to print the first `:= dk/2e batches and we use &#215; R for the remainder. By Lemma 5.1, the batches with higher cost under R have lower cost under &#215; R. Furthermore, with high probability, all batches have cost at most 2n except perhaps the "middle" two batches B and B +1 . More precisely, we utilize the empirical quantiles i/k for i &#8712; [k], where we recall that Q i/k, R (S) denotes the minimum value t i such that an i/k fraction of strands in S have cost at most t i with respect to R. In particular, the bound</p><p>for i &#8712;{ 1,...,`-1} follows from the batch construction process. Similarly, we have that</p><p>for i &#8712;{0, 1,...,k-`-2}, due to Lemma 5.1 and the batch construction process. The bounds in <ref type="bibr">(10)</ref> and ( <ref type="formula">11</ref>) both involve empirical quantiles, for which Lemma 4.1 provides uniform bounds. We apply Lemma 4.1 with &#949; =1 /(4k). This implies that, with probability at least 1 -2exp -M/(8k 2 ) ,w eh a v et h a t</p><p>for all i &#8712;{1,...,`-1}, and furthermore that</p><p>for every i &#8712;{ 0, 1,...,k -`-2}. Plugging these bounds into <ref type="bibr">(10)</ref> and <ref type="bibr">(11)</ref> we obtain that, with probability at least 1 -2exp -M/(8k 2 ) , the total cost is bounded above by</p><p>In the rest of the proof we bound from above these two sums, as well as the term in the middle. First, we claim that for every fixed &#948;&gt;0 there exists &#945; = &#945;(&#948;) &gt; 0 such that</p><p>To see this, recall that the cost of printing a strand S using R is a sum of independent random variables: the cost of the first character is uniform in {1, 2, 3, 4} and the cost of the remaining characters are uniform in {1, 2, 3} (since the strand S does not have homopolymers). Therefore cost R (S) is approximately Gaussian with mean 2n+1/2 and variance on the order of n. This means that if we consider a quantile that is bounded away from the median, then the cost is smaller than the mean by at least a constant factor of the standard deviation. Since the standard deviation is on the order of &#8730; n, this implies <ref type="bibr">(13)</ref>.</p><p>Turning back to <ref type="bibr">(12)</ref>, consider the first dk/3e terms of the first sum in <ref type="bibr">(12)</ref> (note that dk/3e&#8805;1 since k &#8805; 3). Note that (dk/3e +1/4) /k &#8804; 5/12 = 1/2 -1/12 for all k &#8805; 3. Let &#945; * := &#945; (1/12) &gt; 0. Then <ref type="bibr">(13)</ref> implies that for every i &#8712;{1,...,dk/3e} we have that</p><p>Note also that for every i &#8712;{ 1,...,`-1} we have that</p><p>Together with <ref type="bibr">(13)</ref>, this implies that for every i &#8712;{1,...,`-1} we have that</p><p>Putting the bounds in the previous two displays together, we obtain that</p><p>Similarly, note that for every i &#8712;{0, 1,...,k-`-2} we have that (ki -5/4)/k &#8805; 1/2+1/(4k) &gt; 1/2. Therefore, due to the symmetry of the distribution of cost R (S),w eh a v et h a t</p><p>Using this bound in the second sum of ( <ref type="formula">12</ref>), together with ( <ref type="formula">14</ref>), we obtain that the quantity in ( <ref type="formula">12</ref>) is bounded from above by</p><p>Finally, we bound the sum in the curly brackets in <ref type="bibr">(15)</ref>. Let S be a strand in B such that cost R (B )=cost R (S ),a ndl e t S b eas t r a n di nB +1 such that cost &#215; R (B +1 )=cost &#215; R (S ). By the construction of the batching process we have that cost R (S ) &#8804; cost R (S ). On the other hand, by Lemma 5.1 we have that cost R (S )+cost &#215; R (S )=4 n +1. Putting all this together we have that</p><p>Plugging this back into <ref type="bibr">(15)</ref>, we obtain that the total cost is bounded from above by 2kn +1-(&#945; * /3)k &#8730; n, as desired, with this bound holding with probability at least 1 -2exp -M/(8k 2 ) .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Batching for Unrestricted Strands</head><p>The main idea of the proof is to analyze the cost quantiles after splitting into batches. In this case, the optimal splitting is a bit easier to define, as we will always use the reference strand R =( ACGT ) * . Once the reference strand is fixed, it is easy to see that for arbitrary strands, the optimal batching process involves first taking M/k lowest cost strands and then the next M/k lowest cost and so on.</p><p>Proof of Theorem 1.2( <ref type="formula">2</ref>): In this argument, we consider a set S of M strands sampled i.i.d. from the uniform distribution U over {A, C, G, T } n . For simplicity of notation, we let Q q = Q q, R (S) and Q q = Q q, R (U) denote the empirical and distributional q-quantiles of the cost, respectively. We utilize the empirical quantiles i/k for i &#8712; [k], where we recall that Q i/k denotes the minimum value t i such that an i/k fraction of strands in S have cost at most t i . In particular, the bound cost R (B i ) &#8804; Q i/k follows from the batch construction process.</p><p>Lemma 4.1 provides a uniform bound on each empirical quantile, and we apply it with &#949; =1 /k; specifically, this implies that, with probability at least</p><p>In the following we assume that we are on this event; in particular, on this event we have that cost</p><p>We next claim that for any even k &#8804; k -3 we have that</p><p>Before showing <ref type="bibr">(16)</ref>, we conclude the proof assuming that it holds. When k is even, we set k = k -4, and otherwise, k = k -3. Then, for i in the range k &lt;i&#8804; k,w es i m p l y use the bound from Theorem 3.1 that shows that cost R (B i ) &#8804; 2.5n+3 &#8730; n ln M . Combining this with ( <ref type="formula">16</ref>) implies the desired bound with C 2 =12.</p><p>We now turn to proving <ref type="bibr">(16)</ref>. We have already seen in Lemma 5.1 that the cost distribution is symmetric around 2.5n for strands uniform over {A, C, G, T } n . This implies that</p><p>for each i &#8804; k /2.H e r ew eh a v ep a i r e du p(i +1)/k with (ki -2)/k, and hence, we have chosen a cost quantile on either side of the mean, but with a slight asymmetry, shifting the larger one over by one. The key observation is that Q (k-i-2)/k deviates from the mean less than Q (i+1)/k . M o r ep r e c i s e l y ,w eh a v et h a tQ (i+1)/k &#8804; 2.5n &#8804; Q (k-i-2)/k , and furthermore, Q (k-i-2)/k -2.5n &#8804; 2.5n -Q (i+1)/k . As this holds for each i &#8804; k /2, the inequality in ( <ref type="formula">16</ref>) follows.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>VI. LOWER BOUNDS</head><p>In this section we prove Theorem 1.3, which provides lower bounds on the cost of batched DNA synthesis for random strands, for both unconstrained strands and strands without homopolymers.</p><p>We first introduce some notation and terminology. For a strand S, we say that a base S i is a repetition of the previous base if this base is the same as the previous base, that is, if S i = S i-1 .L e td(S) be the number of bases that are repetitions of the previous base in S (that is, d(S): = |{i : S i = S i+1 }|). For every p &#8712; [0, 1] and positive integer n, define a distribution D p,n on DNA strands of length n by letting the probability of a strand S of length n according to D p,n be equal to</p><p>We can think of this distribution as follows. The first base of the strand is chosen uniformly at random from the alphabet {A, C, G, T }. Then, every consecutive base is a repetition of the previous base with probability p and another base with probability (1p). If a base is not a repetition of the previous base, then it is chosen uniformly at random among the remaining three bases. In this paper, the two most important distributions on DNA strands are D 0,n and D1 /4,n . The former is the uniform distribution on strands of length n without homopolymers; the latter is the uniform distribution on strands of length n (unconstrained, i.e., allowing homopolymers). In this section, we will also crucially use another distribution: D1 /4+&#948;,n with &#948; &#8776; log M n . To simplify notation, we will omit the second parameter of the distribution D and write D p &#8801; D p,n ,s i n c e the length of all strands we consider is n.</p><p>We will prove the following theorem, from which Theorem 1.3 readily follows.</p><p>Theorem 6.1: Let S&#8801;S Dp,M be a set of M i.i.d. strands from the distribution D p ,w he rep is 0 or 1 /4. Suppose that M is divisible by k,andk &#8804; M/(24n). Then, with probability at least 1 -2exp(-M/(4k 2 )) &#8805; 1 -2exp(-6n), the optimal cost of printing the strands in S using k batches of equal size is at least k &#8226; (2n-5n log(2k)) for strands w/o homopolymers;</p><p>Furthermore, there exist positive absolute constants c 1 , c 2 ,a n dc 3 such that the following holds in the setting of unconstrained strands (that is, when p = 1 /4). Suppose that the number of batches satisfies k &#8804; c 1 min{ log M/ log log M, n/ log n, 4 &#8730; M/ &#8730; n}. Then, with probability at least 1exp(-c 3 &#8730; M/k 2 ),t h e total cost of printing the strands in S D1 /4 ,M using k batches of equal size is at least</p><p>Proof: We use the approach outlined in the proof overview (see Section II). We first prove the bounds ( <ref type="formula">18</ref>) and <ref type="bibr">(19)</ref>.</p><p>To do so, we show that with high probability the cost of every batch that contains at least n/k strands is greater than 2n -5n log(2k) for random strands without homopolymers and 2.5n -5n log(2k) for unconstrained random strands. Consequently, the total cost of printing k batches is at least k &#8226; (2n -5n log(2k)) and k &#8226; (2.5n -5n log(2k)) for random strands without and with homopolymers, respectively.</p><p>Let R * be the set of all reasonable reference strands for printing strands of lengths n,t h a ti s ,R * is the set of all possible strands of length 4n appended with the infinite repeating sequence (ACGT ) * (see Section II). The size of this set is |R * | =4 4n &lt;e 6n . Recall the notions of the q-quantile Q q,R (D) of the distribution D and the empirical q-quantile Q q,R (S) of a sample S that we introduced in Section IV. Since every batch in the optimal partitioning of the set S contains a 1 /k fraction of all strands, its cost is at least Q1 /k,R * (S). In Lemma 4.1 we showed that Q q,R (S) &#8805; Q q-&#949;,R (D) with probability close to 1 for sufficiently large M . Specifically, using Lemma 4.1 with parameters q = 1 /k, &#949; = q/2,a n d R = R * , we obtain the following bound:</p><p>where in the second inequality we used that |R * | &lt; exp(6n) &#8804; e M/(4k 2 ) ; this holds due to the condition k &#8804; M/(24n) that is assumed in the statement of Theorem 6.1.</p><p>We now obtain lower bounds on Q q,R * (D 0 ), Q q,R * (D1 /4 ), and Q q,R * (D1 /4+&#948; ). Lemma 6.2: For q &#8712; (0, 1) we have that</p><p>Lemma 6.3: For q &#8712; (0, 1) and &#948; &#8712; (0, 1/600] we have that</p><p>We prove Lemmas 6.2 and 6.3 in Section VI-A. Lemma 6.2, combined with inequality <ref type="bibr">(21)</ref>, immediately yield the lower bounds in ( <ref type="formula">18</ref>) and ( <ref type="formula">19</ref>) on the total cost of printing random strands without and with homopolymers.</p><p>We now show how to strengthen the lower bound for unconstrained strands, obtaining the desired inequality <ref type="bibr">(20)</ref>. We will prove that, with probability at least 1exp(-c &#8730; M/k 2 ) for some absolute constant c &gt; 0, there exists a batch with cost at least</p><p>where &#948; =min log(M/16) 16n</p><p>, 1/600 . Thus, using the lower bound from the first part of the theorem for all the other k -1 batches, with probability at least</p><p>the total cost of printing S D1 /4 ,M using k batches is at least</p><p>Now if k &#8804; c 1 min{ log M/ log log M, n/ log n} for a small enough c 1 &gt; 0, then the quantity in the display above is bounded from below by k &#8226; 2.5n + c 2 n min {log M, n} for some c 2 &gt; 0. Thus we have obtained <ref type="bibr">(20)</ref>.</p><p>What remains is to prove the claim in <ref type="bibr">(25)</ref>. The proof of this relies on the following lemma, the proof of which we defer to Section VI-B. Lemma 6.4: For every 0 &#8804; &#948; &#8804; min log(M/16) 16n</p><p>, 0.1 there exists a coupling (S, S ) of random multisets containing strands of length n that satisfies the following:</p><p>1) S has the same distribution as S D1 /4 ,M ;</p><p>2) S has the same distribution as S D1 /4+&#948; , &#8730; M ;a n d 3) there exists an absolute constant c&gt;0 such that</p><p>Consider the pair of random multisets (S, S ) from Lemma 6.4. Since S has the same distribution as S D1 /4 ,M , it suffices to show that, with probability at least 1exp(-c &#8730; M/k 2 ), in every partitioning of S into k batches there exists at least one batch with cost at least 2.5n+ 2 /3 &#948;n-5 n log(6k).L e tS := S&#8745;S .S i n c eS &#8838;S , one of the batches must contain at least a 1 /k fraction of all strands in S . Denote this batch by B and let B := B&#8745;S .If|S |&#8805;|S |/3, then |B |&#8805;| S |/k &#8805;| S |/(3k). Consequently, the cost of printing B at least Q1 /(3k),R * (S ).S i n c eB &#8838;B,t h ec o s t of printing B is also at least Q1 /(3k),R * (S ). By Lemma 6.4, we have that |S |&#8805;| S |/3 with probability at least 1exp(-c &#8730; M ). Thus, with this probability, the cost of printing B is at least Q1 /(3k),R * (S ).</p><p>Now by the inequality (21) (replacing 1 /k with 1 /(3k) and</p><p>where in the second inequality we used that</p><p>)); this holds due to the assumption that k &#8804; 4 &#8730; M/ &#8730; 240n. Finally, by Lemma 6.3 we have that Q1 /(6k),R * (D1 /4+&#948; ) &#8805; 2.5n + 2 /3 &#948;n -5 n log(6k).</p><p>Putting everything together we obtain that, with probability at least 1 -2exp(-&#8730; M/(40k 2 ))exp(-c &#8730; M ),t h ec o s t of printing B is at least 2.5n + 2 /3 &#948;n -5 n log(6k).T h i s concludes the proof of the claim in <ref type="bibr">(25)</ref>.</p><p>We complete the proof of Theorem 6.1 in Sections VI-A and VI-B, where we prove Lemmas 6.2, 6.3, and 6.4.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Proofs of Lemma 6.2 and Lemma 6.3</head><p>Proof of Lemma 6.2: We show that Q q,R * (D 0 ) &#8805; 2n -&#8710; n,q and Q q,R * (D1 /4 ) &#8805; 2.5n -&#8710; n,q ,w h e r e&#8710; n,q := 5n log 1 /q. To establish this inequality, it suffices to prove that for all R &#8712;R * ,</p><p>To do this, we use the stochastic domination argument that we previously used in Section III-C. Let Y 1 ,...,Y n be i.i.d. random variables that are uniformly distributed on {1, 2, 3},a n d let Z 1 ,...,Z n be i.i.d. random variables that are uniformly distributed on {1, 2, 3, 4}. Then, by the same arguments as in Section III-C, we have that</p><p>Thus by Hoeffding's inequality (Theorem 1.1) we have that</p><p>n,q 4n &lt;q;</p><p>n,q 9n &lt;q.</p><p>This completes the proof of ( <ref type="formula">22</ref>) and <ref type="bibr">(23)</ref>.</p><p>Proof of <ref type="bibr">Lemma 6.3:</ref> To prove the claim it suffices to show that for all R &#8712;R * we have that</p><p>Accordingly, we fix R &#8712;R * for the rest of the proof and show <ref type="bibr">(26)</ref>.</p><p>As in Section III-C, for i &#8805; 1 let &#964; i (S, R) denote the index of the base of R that is used to print the ith base of S,a n dl e t&#964; 0 (S, R)=0for notational convenience. For i &#8805; 1,d e fi n eX i (S, R): =&#964; i (S, R)&#964; i-1 (S, R),a n da l s o let Y i := min{X i (S, R), 5}.W h e nS &#8764; D1 /4 , we have seen (see Section III-C) that the distribution of Y i stochastically dominates the uniform distribution on {1, 2, 3, 4},a n di n particular we have that E S&#8764;D1 /4 [Y i | &#964; i-1 (S, R)] &#8805; 2.5.When S &#8764; D1 /4+&#948; , this inequality does not necessarily hold for all i &#8805; 1. However, we still have the following. Claim 6.5: For all i &#8805; 1 we have that</p><p>Proof: Given &#964; i-1 (S, R) (and the knowledge of the fixed reference strand R), we know the support of the random variable X i (S, R), which consists of four distinct positive integers. We also know that the conditional probabilities of taking on each particular value are given by 1 /4 + &#948;, 1 /4&#948; /3, 1 /4&#948; /3,a n d 1 /4&#948; /3, with some particular permutation. The conditional expectation is thus minimized when the support is {1, 2, 3, 4} and the largest probability 1 /4 + &#948; is assigned to 1.</p><p>Hence,</p><p>We now show that, by averaging over three consecutive terms, we can obtain a better lower bound on the conditional expectation that is strictly greater than 2.5 on average. Lemma 6.6: For every i &#8712;{ 1,...,n -2} and &#948; &#8712; (0, 1/600],w eh a v et h a t</p><p>(28) Proof: For i &#8805; 1 let &#964; * := &#964; i-1 (S, R) and note that for i &#8805; 2, by definition, R &#964; * is the base of the reference strand R which is used for printing base i -1 of strand S. Consider the next 12 bases of the reference strand, that is, the substrand</p><p>First, suppose that this substrand is a triple repetition of some permutation of the bases A, C, G, T . For example,</p><p>Then, for j &#8712;{i +1,i+2}, the conditional distribution of Y j given &#964; i-1 (S, R) is given by: Y j =1, Y j =2,a n dY j =3all with probability 1 /4&#948; /3,a ndY j =4with probability 1 /4 + &#948;. Thus,</p><p>By Claim 6.5 we have that E S&#8764;D1 /4+&#948; Y i | &#964; i-1 (S, R) &#8805; 2.5 -2&#948;. By adding up these bounds, we obtain the desired bound <ref type="bibr">(28)</ref>. Now consider the second case: that the substrand R &#964; * +1 , &#8226;&#8226;&#8226; ,R &#964; * +12 is not a triple repetition of the same permutation of A, C, G, T . Then, this substrand must contain four consecutive bases that are not a permutation of A, C, G, T .L e t&#964; be the index of the base just before the first such quadruple of bases. By construction we must have &#964; &#8712; {&#964; * ,&#964; * +1,...,&#964; * +8}.S i n c eR &#964; +1 ,R &#964; +2 ,R &#964; +3 ,R &#964; +4 is not a permutation of A, C, G, T , at least one letter from the alphabet {A, C, G, T } is absent in this quadruple. Hence, if &#964; j (S, R)=&#964; for some j, then the expected next jump is at least</p><p>We now distinguish three cases depending on whether &#964; = &#964; * or &#964; &#8712;{ &#964; * +1,...,&#964; * +4} or &#964; &#8712; {&#964; * +5,...,&#964; * +8}.F i r s t ,i f&#964; = &#964; * , then by <ref type="bibr">(29)</ref> we have that E S&#8764;D1 /4+&#948; [Y i | &#964; i-1 (S, R)] &#8805; 2.5+(0.25-7 /3 &#948;).W ealso have, by Claim 6.5 and the tower rule, that E S&#8764;D1 /4+&#948; [Y j | &#964; i-1 (S, R)] &#8805; 2.5 -2&#948; for j &#8712;{ i +1,i+2}. Putting these bounds together we have, if &#964; = &#964; * ,t h a t</p><p>where the last inequality holds when &#948; &#8804; 0.03.T h i s shows <ref type="bibr">(28)</ref> in this case.</p><p>Next, suppose that &#964; &#8712;{&#964; * +1,...,&#964; * +4}. By Claim 6.5 we have that</p><p>In order to bound E S&#8764;D1 /4+&#948; [Y i+1 | &#964; i-1 (S, R)],w efi r s t condition on &#964; i (S, R). Note that since &#964; &gt;&#964; * , the bases R &#964; * +1 ,...,R &#964; * +4 are all different. Therefore we must have that &#964; i (S, R) &#8712;{ &#964; * +1 ,...,&#964; * +4 }. Conditioning on the value of &#964; i (S, R) we thus have that</p><p>where all expectations and probabilities are under S &#8764; D1 /4+&#948; . We then use <ref type="bibr">(29)</ref> to bound from below the first expectation in the sum above, and we use Claim 6.5 to bound from below the second expectation. Plugging in these bounds we obtain that</p><p>where the last inequality holds when &#948; &#8804; 1/200. Putting together <ref type="bibr">(30)</ref> and <ref type="bibr">(31)</ref> we obtain <ref type="bibr">(28)</ref> in this case as well. Finally, suppose that &#964; &#8712;{ &#964; * +5,...,&#964; * +8}. By Claim 6.5 we have that</p><p>Authorized licensed use limited to: Princeton University. Downloaded on December 09,2022 at 14:43:26 UTC from IEEE Xplore. Restrictions apply.</p><p>In order to bound E S&#8764;D1 /4+&#948; [Y i+2 | &#964; i-1 (S, R)],w efi r s t condition on &#964; i+1 (S, R). Note that since &#964; &gt;&#964; * + 4, the bases R &#964; * +1 ,...,R &#964; * +4 are all different, and the bases R &#964; * +5 ,...,R &#964; * +8 are a repetition of the bases R &#964; * +1 ,...,R &#964; * +4 .T h i si m p l i e st h a t&#964; i (S, R) &#8712;{ &#964; * + 1,...,&#964; * +4}, and, moreover, that given &#964; i (S, R),w eh a v e that &#964; i+1 (S, R) &#8712;{ &#964; i (S, R)+1,...,&#964; i (S, R)+4}.I np a rticular, note that if &#964; i (S, R)=&#964; -4 and S i+1 = S i , then &#964; i+1 (S, R)=&#964; . Thus conditioning on whether or not &#964; i+1 (S, R)=&#964; occurs, we have that</p><p>As before, we use <ref type="bibr">(29)</ref> to bound from below the first expectation in the sum above, and we use Claim 6.5 to bound from below the second expectation. Plugging in these bounds we obtain that</p><p>Since &#964; i (S, R)=&#964; -4 and S i+1 = S i together imply that &#964; i+1 (S, R)=&#964; ,w eh a v et h a t</p><p>Putting together the two previous displays we obtain that</p><p>where the last inequality holds whenever &#948; &#8804; 1/600. Putting together <ref type="bibr">(32)</ref> and <ref type="bibr">(33)</ref> we obtain <ref type="bibr">(28)</ref> in this case as well. This concludes all cases and hence concludes the proof. We now conclude the proof of <ref type="bibr">(26)</ref>. For simplicity, we assume in the following that n is divisible by 3; the case of n not being divisible by 3 can be handled by padding. Let Z 0 := 0 and for t &#8712;{1,...,n/3} let</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>By definition we have that</head><p>and so P S&#8764;D1 /4+&#948; cost R (S) &#8804; 2.5n+ 2 /3 &#948;n -5 n log 1 /q &#8804; P S&#8764;D1 /4+&#948; Z n/3 &#8804;-5 n log 1 /q . (34) Lemma 6.6 implies that {Z t } n/3 t=0 is a submartingale with respect to its natural filtration. Since Y i &#8712;{1,...,5} for every i &#8805; 1, the submartingale differences satisfy Z t+1 -Z t = (Y 3t+1 +Y 3t+2 +Y 3t+3 )-3(2.5+ 2 /3&#948;) &#8712; [-4.5-2&#948;, 7.5-2&#948;], that is, they take values in an interval of length 12. Thus by the Azuma-Hoeffding inequality (see, e.g., <ref type="bibr">[54]</ref>) we have that</p><p>Putting together <ref type="bibr">(34)</ref> and <ref type="bibr">(35)</ref> we obtain <ref type="bibr">(26)</ref>. For all strands S &#8712;Lwe have that</p><p>) Proof: First observe that for all S &#8712; &#931; n we have that S) .</p><p>For S &#8712;Lwe have that d(S) &#8804; ( 1 /4 + &#948;)n +1 by definition. Plugging this bound into the display above we obtain for S &#8712; L that</p><p>We now bound from above the three factors on the right hand side. The first factor is at most 1,s i n c e (1 -4 /3 &#948;) 3 (1 + 4&#948;) &#8804; 1 by the AM-GM inequality. The third factor is bounded from above by 2 for &#948; &#8712; [0, 1 /10]. Finally, to bound the second factor, observe that the quadratic function</p><p>is negative for x &#8712; (0, 1 /4). Hence, (1 + 4&#948;)/(1 -4 /3 &#948;) &#8804; (1 + 8&#948;) for &#948; &#8712; [0, 1/4] and so Combining these bounds we obtain that where in the last inequality we used that 0 &#8804; &#948; &#8804; log(M/16) 16n and that &#966; =1/ &#8730; M . We also need to estimate the probability of the set L. Claim 6.8: We have that D1 /4+&#948; (L) &#8805; 1 /2.</p><p>Proof: The number of repetitions d(S) for random strands S &#8764; D p has a binomial distribution B(n -1,p). The median of the binomial distribution B(n -1,p) is at most d(n -1)pe. Thus, P S&#8764;Dp {d(S) &#8804;d (n -1)pe} &#8805; 1/2 and hence D1 /4+&#948; (L) &#8805; 1 /2. We now return to the proof of Lemma 6. Claim 6.9: A and B are probability measures on &#931; n .That is, A and B are nonnegative and A(&#931; n )=B(&#931; n )=1.</p><p>Proof: If S &#8764; D1 /4+&#948; , then the conditional distribution of S given that S &#8712;Lis exactly given by A.I no t h e rw o r d s , for every S &#8712; &#931; n we have that P S&#8764;D1 /4+&#948; (S = S | S &#8712; L)=A(S ). Therefore A is a probability measure. It is easy to verify that B(&#931; n )=1:</p><p>Thus, it remains to show that B is nonnegative. For S/ &#8712;L we have that A(S)=0 ,s oB(S)=D1 /4 (S)/(1&#966;) &#8805; 0. By Claim 6.8 we know that D1 /4+&#948; (L) &#8805; 1 /2,s of o re v e r y S &#8712;Lwe have that A(S) &#8804; 2 D1 /4+&#948; (S). Therefore for every S &#8712;Lwe have that</p><p>where the last inequality is a consequence of Claim 6.7. We now show how to define the coupling (S, S ) satisfying the three conditions of Lemma 6.4. Let S 1 ,S 2 ,...,b ea n infinite sequence of i.i.d. random strands, where each strand S i is distributed according to the distribution D1 /4+&#948; .L e t L 1 ,L 2 ,..., be the subsequence of strands that belong to the set L. Note in particular that, by construction, L 1 ,L 2 ,..., are i.i.d. strands distributed according to the distribution A.</p><p>First, let S := S 1 ,S 2 ,...,S &#8730; M . By construction we have that S has the same distribution as S D1 /4+&#948; , &#8730; M ,w h i c h shows part (a) of the claim.</p><p>Next, we define S. We generate the strands of S one by one. For each i =1 ,...,M, we flip a coin: with probability &#966;, we add the first not yet selected strand from the sequence {L j } j&#8805;1 to S; with the remaining probability (1&#966;), we add an independent random strand drawn from the distribution B to S. By construction the strands in S are i.i.  </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>APPENDIX A STANDARD TAIL BOUNDS</head><p>We recall Hoeffding's inequality (see, e.g., <ref type="bibr">[54]</ref>), which we use throughout our proofs.</p><p>Theorem 1.1 (Hoeffding's Inequality): Let X 1 ,...,X n be independent random variables such that X i takes its values in [a i ,b i ] almost surely for all i &#8804; n.L e tS n := X 1 + ...+ X n . Then for every t&gt;0 we have that</p><p>We also recall the Paley-Zygmund inequality (see, e.g., <ref type="bibr">[54]</ref>). .</p><p>We use the Paley-Zygmund inequality to prove a lower bound on the right tail of the sum of i.i.d. random variables that occur in the proofs of our lower bound results.</p><p>Lemma 1.3: Let `&#8805; 2 be a fixed positive integer. Let {Y i } n i=1 be i.i.d. random variables that are uniform on {1, 2,...,`}.F o r&#955; satisfying 0 &lt;&#955;&#8804; `n/50 we have that</p><p>In particular, when `&#8730;n/3 &#8804; &#955; &#8804; `n/50,w eh a v et h a t</p><p>We note that this bound is sharp up to a universal multiplicative constant in the exponent, as witnessed by Hoeffding's inequality (Theorem 1.1).</p><p>Proof: To abbreviate notation, let .</p><p>In order to do so, we must have &#952; &#8712; [0, 1],s o&#955; must satisfy</p><p>For t&gt;0 and &#955; satisfying <ref type="bibr">(40)</ref> we have by <ref type="bibr">(39)</ref> and Lemma 1.2 that</p><p>In </p><p>For the second factor, note that e x 2 /25 &#8804; e x/2e -x/2</p><p>x &#8804; e x 2 /20 , where the first inequality holds for all x &#8712; (0, 1] and the second inequality holds for all x&gt;0. Thus for all t &#8712; (0, 1/`] we have that e t In this section we prove Lemma 4.1 about the empirical quantiles of the distribution of the random variable cost R (S), where S is a random strand.</p><p>Proof of Lemma 4.1: By the Dvoretzky-Kiefer-Wolfowitz inequality ( <ref type="bibr">[55]</ref>, <ref type="bibr">[56]</ref>), the empirical cumulative distribution function for cost R (S) is very close to the cumulative distribution function for cost R (S) &#8804; t with high probability over the random choice of the set S D,M . Specifically, we have We show that if E occurs then for all q &#8712; (&#949;, 1&#949;),w eh a v e Q q-&#949;,R (D) &#8804; Q q,R (S D,M ) &#8804; Q q+&#949;,R (D), and, therefore, (6) holds. Inequality <ref type="bibr">(7)</ref> follows from ( <ref type="formula">6</ref>) by a union bound over all R in R.</p><p>We first show that Q q,R (S D,M ) &#8805; Q q-&#949;,R (D) for all q &#8712; (&#949;, 1). Consider an arbitrary q &#8712; (&#949;, 1) and let t * = Q q-&#949;,R (D) -1.S i n c et * &lt;Q q-&#949;,R (D),w eh a v e P cost R (S) &#8804; t * &lt;q-&#949; and |{S &#8712;S: cost R (S) &#8804; t * }| |S| &#8804; P cost R (S) &#8804; t * + &#949;&lt;q.</p><p>Hence, Q q,R (S D,M ) &gt;t * , and since Q q,R (S D,M ) is an integer, Q q,R (S D,M ) &#8805; Q q-&#949;,R (D). We now show that Q q,R (S D,M ) &#8804; Q q+&#949;,R (D) for all q &#8712; (0, 1&#949;). Consider an arbitrary q &#8712; (0, 1&#949;) and let t * * = Q q+&#949;,R (D). By the definition of Q q,R (D),w eh a v e P cost R (S) &#8804; t * * &#8805; q + &#949; and |{S &#8712;S: cost R (S) &#8804; t * * }| |S| &#8805; P cost R (S) &#8804; t * *&#949; &#8805; q.</p><p>Hence, Q q,R (S D,M ) &#8804; t * * = Q q+&#949;,R (D).</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_0"><p>Authorized licensed use limited to: Princeton University. Downloaded on December 09,2022 at 14:43:26 UTC from IEEE Xplore. Restrictions apply.</p></note>
		</body>
		</text>
</TEI>
