<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[Azimuth]]></provider_name><provider_url><![CDATA[https://johncarlosbaez.wordpress.com]]></provider_url><author_name><![CDATA[John Baez]]></author_name><author_url><![CDATA[https://johncarlosbaez.wordpress.com/author/johncarlosbaez/]]></author_url><title><![CDATA[Network Theory (Part&nbsp;21)]]></title><type><![CDATA[link]]></type><html><![CDATA[<p>Recently we&#8217;ve been talking about &#8216;reaction networks&#8217;, like this:</p>
<div align="center">
<img width="230" src="https://i2.wp.com/math.ucr.edu/home/baez/networks/chemical_reaction_network_part_20_V.png" alt="" />
</div>
<p>The letters are names of chemicals, and the arrows are chemical reactions.   If we know how fast each reaction goes, we can write down a &#8216;rate equation&#8217; describing how the amount of each chemical changes with time.   </p>
<p>In <a href="http://math.ucr.edu/home/baez/networks/networks_17.html">Part 17</a> we met the deficiency zero theorem.  This is a powerful tool for finding <i>equilibrium solutions</i> of the rate equation: in other words, solutions where the amounts of the various chemicals don&#8217;t change at all.   To apply this theorem, two conditions must hold.   Both are quite easy to check:</p>
<p>&bull; Your reaction network needs to be &#8216;weakly reversible&#8217;: if you have a reaction that takes one bunch of chemicals to another, there&#8217;s a series of reactions that takes that other bunch back to the one you started with.  </p>
<p>&bull; A number called the &#8216;deficiency&#8217; that you can compute from your reaction network needs to be zero.</p>
<p>The first condition makes a lot of sense, intuitively: you won&#8217;t get an equilibrium with all the different chemicals present if some chemicals can turn into others but not the other way around.   But the second condition, and indeed the concept of &#8216;deficiency&#8217;, seems mysterious.</p>
<p>Luckily, when you work through the proof of the deficiency zero theorem, the mystery evaporates.   It turns out that there are two equivalent ways to define the deficiency of a reaction network.  One makes it easy to compute, and that&#8217;s the definition people usually give.  But the other explains why it&#8217;s important.</p>
<p>In fact the whole proof of the deficiency zero theorem is full of great insights, so I want to show it to you.  This will be the most intense part of the network theory series so far, but also the climax of its first phase.  After a little wrapping up, we will then turn to another kind of network: <i>electrical circuits!</i>  </p>
<p>Today I&#8217;ll just unfold the concept of &#8216;deficiency&#8217; so we see what it means.  Next time I&#8217;ll show you a slick way to write the rate equation, which is crucial to proving the deficiency zero theorem.  Then we&#8217;ll start the proof.</p>
<h3> Reaction networks </h3>
<p>Let&#8217;s recall what a reaction network is, and set up our notation.  In chemistry we consider a finite set of &#8216;species&#8217; like C, O<sub>2</sub>, H<sub>2</sub>O and so on&#8230; and then consider reactions like</p>
<p>CH<sub>4</sub> + 2O<sub>2</sub> <img src='https://s0.wp.com/latex.php?latex=%5Clongrightarrow&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;longrightarrow' title='&#92;longrightarrow' class='latex' /> CO<sub>2</sub> + 2H<sub>2</sub>O </p>
<p>On each side of this reaction we have a finite linear combination of species, with natural numbers as coefficients.  Chemists call such a thing a <b>complex</b>.</p>
<p>So, given any finite collection of species, say <img src='https://s0.wp.com/latex.php?latex=S%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S,' title='S,' class='latex' /> let&#8217;s write <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BN%7D%5ES&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{N}^S' title='&#92;mathbb{N}^S' class='latex' /> to mean the set of finite linear combinations of elements of <img src='https://s0.wp.com/latex.php?latex=S%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S,' title='S,' class='latex' /> with natural numbers as coefficients.   The complexes appearing in our reactions will form a subset of this, say <img src='https://s0.wp.com/latex.php?latex=K.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='K.' title='K.' class='latex' />   </p>
<p>We&#8217;ll also consider a finite collection of reactions&#8212;or in the language of <a href="http://math.ucr.edu/home/baez/networks/networks_2.html">Petri nets</a>, &#8216;transitions&#8217;.  Let&#8217;s call this <img src='https://s0.wp.com/latex.php?latex=T&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='T' title='T' class='latex' />.  Each transition goes from some complex to some other complex: if we want a reaction to be reversible we&#8217;ll explicitly include another reaction going the other way.  So, given a transition <img src='https://s0.wp.com/latex.php?latex=%5Ctau+%5Cin+T&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;tau &#92;in T' title='&#92;tau &#92;in T' class='latex' /> it will always go from some complex called its <b>source</b> <img src='https://s0.wp.com/latex.php?latex=s%28%5Ctau%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s(&#92;tau)' title='s(&#92;tau)' class='latex' /> to some complex called its <b>target</b> <img src='https://s0.wp.com/latex.php?latex=t%28%5Ctau%29.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='t(&#92;tau).' title='t(&#92;tau).' class='latex' /></p>
<p>All this data, put together, is a reaction network:</p>
<p><b> Definition.</b> A <b>reaction network</b> <img src='https://s0.wp.com/latex.php?latex=%28S%2C%5C%3B+s%2Ct+%3A+T+%5Cto+K%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='(S,&#92;; s,t : T &#92;to K)' title='(S,&#92;; s,t : T &#92;to K)' class='latex' /> consists of:</p>
<p>&bull; a finite set <img src='https://s0.wp.com/latex.php?latex=S&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S' title='S' class='latex' /> of <b>species</b>, </p>
<p>&bull; a finite set <img src='https://s0.wp.com/latex.php?latex=T&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='T' title='T' class='latex' /> of <b>transitions</b>,</p>
<p>&bull; a finite set <img src='https://s0.wp.com/latex.php?latex=K+%5Csubset+%5Cmathbb%7BN%7D%5ES&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='K &#92;subset &#92;mathbb{N}^S' title='K &#92;subset &#92;mathbb{N}^S' class='latex' /> of <b>complexes</b>,</p>
<p>&bull; <b>source</b> and <b>target</b> maps <img src='https://s0.wp.com/latex.php?latex=s%2Ct+%3A+T+%5Cto+K.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s,t : T &#92;to K.' title='s,t : T &#92;to K.' class='latex' /></p>
<p>We can draw a reaction network as a graph with complexes as vertices and transitions as edges:</p>
<div align="center">
<img width="200" src="https://i1.wp.com/math.ucr.edu/home/baez/networks/chemical_reaction_network_part_20_I.png" alt="" />
</div>
<p>The set of species here is <img src='https://s0.wp.com/latex.php?latex=S+%3D+%5C%7BA%2CB%2CC%2CD%2CE%5C%7D%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S = &#92;{A,B,C,D,E&#92;},' title='S = &#92;{A,B,C,D,E&#92;},' class='latex' /> and the set of complexes is <img src='https://s0.wp.com/latex.php?latex=K+%3D+%5C%7BA%2CB%2CD%2CA%2BC%2CB%2BE%5C%7D.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='K = &#92;{A,B,D,A+C,B+E&#92;}.' title='K = &#92;{A,B,D,A+C,B+E&#92;}.' class='latex' /></p>
<p>But to write down the &#8216;rate equation&#8217; describing our chemical reactions, we need a bit more information: constants <img src='https://s0.wp.com/latex.php?latex=r%28%5Ctau%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='r(&#92;tau)' title='r(&#92;tau)' class='latex' /> saying the rate at which each transition <img src='https://s0.wp.com/latex.php?latex=%5Ctau&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;tau' title='&#92;tau' class='latex' /> occurs.   So, we define:</p>
<p><b> Definition.</b> A <b>stochastic reaction network</b> is a reaction network together with a map <img src='https://s0.wp.com/latex.php?latex=r%3A+T+%5Cto+%280%2C%5Cinfty%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='r: T &#92;to (0,&#92;infty)' title='r: T &#92;to (0,&#92;infty)' class='latex' /> assigning a <b>rate constant</b> to each transition.</p>
<p>Let me remind you how the rate equation works.  At any time we have some amount <img src='https://s0.wp.com/latex.php?latex=x_i+%5Cin+%5B0%2C%5Cinfty%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x_i &#92;in [0,&#92;infty)' title='x_i &#92;in [0,&#92;infty)' class='latex' /> of each species <img src='https://s0.wp.com/latex.php?latex=i.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i.' title='i.' class='latex' />  These numbers are the components of a vector <img src='https://s0.wp.com/latex.php?latex=x+%5Cin+%5Cmathbb%7BR%7D%5ES%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x &#92;in &#92;mathbb{R}^S,' title='x &#92;in &#92;mathbb{R}^S,' class='latex' /> which of course depends on time.  The <b>rate equation</b> says how this vector changes:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Cfrac%7Bd+x_i%7D%7Bd+t%7D+%3D+%5Csum_%7B%5Ctau+%5Cin+T%7D+r%28%5Ctau%29+%5Cleft%28t_i%28%5Ctau%29+-+s_i%28%5Ctau%29%5Cright%29++x%5E%7Bs%28%5Ctau%29%7D+%7D++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ &#92;frac{d x_i}{d t} = &#92;sum_{&#92;tau &#92;in T} r(&#92;tau) &#92;left(t_i(&#92;tau) - s_i(&#92;tau)&#92;right)  x^{s(&#92;tau)} }  ' title='&#92;displaystyle{ &#92;frac{d x_i}{d t} = &#92;sum_{&#92;tau &#92;in T} r(&#92;tau) &#92;left(t_i(&#92;tau) - s_i(&#92;tau)&#92;right)  x^{s(&#92;tau)} }  ' class='latex' /> </p>
<p>Here I&#8217;m writing <img src='https://s0.wp.com/latex.php?latex=s_i%28%5Ctau%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s_i(&#92;tau)' title='s_i(&#92;tau)' class='latex' /> for the <img src='https://s0.wp.com/latex.php?latex=i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i' title='i' class='latex' />th component of the vector <img src='https://s0.wp.com/latex.php?latex=s%28%5Ctau%29%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s(&#92;tau),' title='s(&#92;tau),' class='latex' /> and similarly for <img src='https://s0.wp.com/latex.php?latex=t_i%28%5Ctau%29.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='t_i(&#92;tau).' title='t_i(&#92;tau).' class='latex' />   I should remind you what <img src='https://s0.wp.com/latex.php?latex=x%5E%7Bs%28%5Ctau%29%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x^{s(&#92;tau)}' title='x^{s(&#92;tau)}' class='latex' /> means, since here we are raising a vector to a vector power, which is a bit unusual.   So, suppose we have any vector </p>
<p><img src='https://s0.wp.com/latex.php?latex=x+%3D+%28x_1%2C+%5Cdots%2C+x_k%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x = (x_1, &#92;dots, x_k)' title='x = (x_1, &#92;dots, x_k)' class='latex' /> </p>
<p>and we raise it to the power of </p>
<p><img src='https://s0.wp.com/latex.php?latex=s+%3D+%28s_1%2C+%5Cdots%2C+s_k%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s = (s_1, &#92;dots, s_k)' title='s = (s_1, &#92;dots, s_k)' class='latex' />  </p>
<p>Then by definition we get</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+x%5Es+%3D+x_1%5E%7Bs_1%7D+%5Ccdots+x_k%5E%7Bs_k%7D+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ x^s = x_1^{s_1} &#92;cdots x_k^{s_k} } ' title='&#92;displaystyle{ x^s = x_1^{s_1} &#92;cdots x_k^{s_k} } ' class='latex' /></p>
<p>Given this, I hope the rate equation makes intuitive sense!  There&#8217;s one term for each transition <img src='https://s0.wp.com/latex.php?latex=%5Ctau.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;tau.' title='&#92;tau.' class='latex' />   The factor of <img src='https://s0.wp.com/latex.php?latex=t_i%28%5Ctau%29+-+s_i%28%5Ctau%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='t_i(&#92;tau) - s_i(&#92;tau)' title='t_i(&#92;tau) - s_i(&#92;tau)' class='latex' /> shows up because our transition destroys <img src='https://s0.wp.com/latex.php?latex=s_i%28%5Ctau%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s_i(&#92;tau)' title='s_i(&#92;tau)' class='latex' /> things of the <img src='https://s0.wp.com/latex.php?latex=i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i' title='i' class='latex' />th species and creates <img src='https://s0.wp.com/latex.php?latex=t_i%28%5Ctau%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='t_i(&#92;tau)' title='t_i(&#92;tau)' class='latex' /> of them. The big product </p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+x%5E%7Bs%28%5Ctau%29%7D+%3D+x_1%5E%7Bs_1%28%5Ctau%29%7D+%5Ccdots+x_k%5E%7Bs_k%28%5Ctau%29%7D+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ x^{s(&#92;tau)} = x_1^{s_1(&#92;tau)} &#92;cdots x_k^{s_k(&#92;tau)} } ' title='&#92;displaystyle{ x^{s(&#92;tau)} = x_1^{s_1(&#92;tau)} &#92;cdots x_k^{s_k(&#92;tau)} } ' class='latex' /></p>
<p>shows up because our transition occurs at a rate proportional to the product of the numbers of things it takes as inputs.  The constant of proportionality is the reaction rate <img src='https://s0.wp.com/latex.php?latex=r%28%5Ctau%29.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='r(&#92;tau).' title='r(&#92;tau).' class='latex' />  </p>
<p>The deficiency zero theorem says lots of things, but in the next few episodes we&#8217;ll prove a weak version, like this:</p>
<p><b> Deficiency Zero Theorem (Baby Version).</b>   Suppose we have a weakly reversible reaction network with deficiency zero.  Then for any choice of rate constants there exists an equilibrium solution <img src='https://s0.wp.com/latex.php?latex=x+%5Cin+%280%2C%5Cinfty%29%5ES&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x &#92;in (0,&#92;infty)^S' title='x &#92;in (0,&#92;infty)^S' class='latex' /> of the rate equation.  In other words:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Csum_%7B%5Ctau+%5Cin+T%7D+r%28%5Ctau%29+%5Cleft%28t_i%28%5Ctau%29+-+s_i%28%5Ctau%29%5Cright%29++x%5E%7Bs%28%5Ctau%29%7D+%3D+0%7D++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ &#92;sum_{&#92;tau &#92;in T} r(&#92;tau) &#92;left(t_i(&#92;tau) - s_i(&#92;tau)&#92;right)  x^{s(&#92;tau)} = 0}  ' title='&#92;displaystyle{ &#92;sum_{&#92;tau &#92;in T} r(&#92;tau) &#92;left(t_i(&#92;tau) - s_i(&#92;tau)&#92;right)  x^{s(&#92;tau)} = 0}  ' class='latex' /> </p>
<p>An important feature of this result is that all the components of the vector <img src='https://s0.wp.com/latex.php?latex=x&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x' title='x' class='latex' /> are <i>positive</i>.  In other words, there&#8217;s actually some chemical of each species present!  </p>
<p>But what do the hypotheses in this theorem mean?</p>
<p>A reaction network is <b>weakly reversible</b> if for any transition <img src='https://s0.wp.com/latex.php?latex=%5Ctau+%5Cin+T&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;tau &#92;in T' title='&#92;tau &#92;in T' class='latex' /> going from a complex <img src='https://s0.wp.com/latex.php?latex=%5Ckappa&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;kappa' title='&#92;kappa' class='latex' /> to a complex <img src='https://s0.wp.com/latex.php?latex=%5Ckappa%27%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;kappa&#039;,' title='&#92;kappa&#039;,' class='latex' /> there is a sequence of transitions going from <img src='https://s0.wp.com/latex.php?latex=%5Ckappa%27&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;kappa&#039;' title='&#92;kappa&#039;' class='latex' /> back to <img src='https://s0.wp.com/latex.php?latex=%5Ckappa.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;kappa.' title='&#92;kappa.' class='latex' />  But what about &#8216;deficiency zero&#8217;?  As I mentioned, this requires more work to understand.  </p>
<p>So, let&#8217;s dive in!  </p>
<h3> Deficiency </h3>
<p>In modern math, we like to take all the stuff we&#8217;re thinking about and compress it into a diagram with a few objects and maps going between these objects.   So, to understand the deficiency zero theorem, I wanted to isolate the crucial maps.  For starters, there&#8217;s an obvious map</p>
<p><img src='https://s0.wp.com/latex.php?latex=Y+%3A+K+%5Cto+%5Cmathbb%7BN%7D%5ES++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Y : K &#92;to &#92;mathbb{N}^S  ' title='Y : K &#92;to &#92;mathbb{N}^S  ' class='latex' /> </p>
<p>sending each complex to the linear combination of species that it is.  </p>
<p>Indeed, we can change viewpoints a bit and think of <img src='https://s0.wp.com/latex.php?latex=K&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='K' title='K' class='latex' /> as an abstract set equipped with this map saying how each complex is made of species.  From now on this is what we&#8217;ll do.  Then all the information in a stochastic reaction network sits in this diagram:</p>
<div align="center">
<img src="https://i1.wp.com/math.ucr.edu/home/baez/networks/reaction_network_diagram_1.png" alt="" />
</div>
<p>This is fundamental to everything we&#8217;ll do for the next few episodes, so take a minute to lock it into your brain.</p>
<p>We&#8217;ll do lots of different things with this diagram.  For example, we often want to use ideas from linear algebra, and then we want our maps to be linear.   For example, <img src='https://s0.wp.com/latex.php?latex=Y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Y' title='Y' class='latex' /> extends uniquely to a linear map</p>
<p><img src='https://s0.wp.com/latex.php?latex=Y+%3A+%5Cmathbb%7BR%7D%5EK+%5Cto+%5Cmathbb%7BR%7D%5ES++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Y : &#92;mathbb{R}^K &#92;to &#92;mathbb{R}^S  ' title='Y : &#92;mathbb{R}^K &#92;to &#92;mathbb{R}^S  ' class='latex' /> </p>
<p>sending real linear combinations of complexes to real linear combinations of species.   Reusing the name <img src='https://s0.wp.com/latex.php?latex=Y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Y' title='Y' class='latex' /> here won&#8217;t cause confusion.  We can also extend <img src='https://s0.wp.com/latex.php?latex=r%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='r,' title='r,' class='latex' /> <img src='https://s0.wp.com/latex.php?latex=s%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s,' title='s,' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=t&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='t' title='t' class='latex' /> to linear maps in a unique way, getting a little diagram like this:</p>
<div align="center">
<img src="https://i1.wp.com/math.ucr.edu/home/baez/networks/reaction_network_diagram_2.png" alt="" />
</div>
<p>Linear algebra lets us talk about <i>differences</i> of complexes.  Each transition <img src='https://s0.wp.com/latex.php?latex=%5Ctau&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;tau' title='&#92;tau' class='latex' /> gives a vector</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cpartial%28%5Ctau%29+%3D+t%28%5Ctau%29+-+s%28%5Ctau%29+%5Cin+%5Cmathbb%7BR%7D%5EK++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;partial(&#92;tau) = t(&#92;tau) - s(&#92;tau) &#92;in &#92;mathbb{R}^K  ' title='&#92;partial(&#92;tau) = t(&#92;tau) - s(&#92;tau) &#92;in &#92;mathbb{R}^K  ' class='latex' /> </p>
<p>saying the change in complexes that it causes.  And we can extend <img src='https://s0.wp.com/latex.php?latex=%5Cpartial&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;partial' title='&#92;partial' class='latex' /> uniquely to a linear map</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cpartial+%3A+%5Cmathbb%7BR%7D%5ET+%5Cto+%5Cmathbb%7BR%7D%5EK++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;partial : &#92;mathbb{R}^T &#92;to &#92;mathbb{R}^K  ' title='&#92;partial : &#92;mathbb{R}^T &#92;to &#92;mathbb{R}^K  ' class='latex' /> </p>
<p>defined on linear combinations of transitions.  Mathematicians would call <img src='https://s0.wp.com/latex.php?latex=%5Cpartial&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;partial' title='&#92;partial' class='latex' /> a <b>boundary operator</b>.</p>
<p>So, we have a little sequence of linear maps</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D%5ET+%5Cstackrel%7B%5Cpartial%7D%7B%5Cto%7D+%5Cmathbb%7BR%7D%5EK+%5Cstackrel%7BY%7D%7B%5Cto%7D+%5Cmathbb%7BR%7D%5ES+++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{R}^T &#92;stackrel{&#92;partial}{&#92;to} &#92;mathbb{R}^K &#92;stackrel{Y}{&#92;to} &#92;mathbb{R}^S   ' title='&#92;mathbb{R}^T &#92;stackrel{&#92;partial}{&#92;to} &#92;mathbb{R}^K &#92;stackrel{Y}{&#92;to} &#92;mathbb{R}^S   ' class='latex' /> </p>
<p>This turns a transition into a change in complexes, and then a change in species.   </p>
<p>If you know fancy math you&#8217;ll be wondering if this sequence is a &#8216;chain complex&#8217;, which is a fancy way of saying that <img src='https://s0.wp.com/latex.php?latex=Y+%5Cpartial+%3D+0.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Y &#92;partial = 0.' title='Y &#92;partial = 0.' class='latex' />  The answer is no.   This equation means that every linear combination of reactions leaves the amount of all species unchanged.   Or equivalently: every reaction leaves the amount of all species unchanged.   This only happens in very silly examples.</p>
<p>Nonetheless, it&#8217;s <i>possible</i> for a linear combination of reactions to leave the amount of all species unchanged.</p>
<p>For example, this will happen if we have a linear combination of reactions that leaves the amount of all <i>complexes</i> unchanged.   But this sufficient condition is not necessary.  And this leads us to the concept of &#8216;deficiency zero&#8217;:</p>
<p><b> Definition.</b>  A reaction network has <b>deficiency zero</b> if any linear combination of reactions that leaves the amount of every species unchanged also leaves the amount of every complex unchanged.</p>
<p>In short, a reaction network has deficiency zero iff</p>
<p><img src='https://s0.wp.com/latex.php?latex=Y+%28%5Cpartial+%5Crho%29+%3D+0+%5Cimplies+%5Cpartial+%5Crho+%3D+0+++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Y (&#92;partial &#92;rho) = 0 &#92;implies &#92;partial &#92;rho = 0   ' title='Y (&#92;partial &#92;rho) = 0 &#92;implies &#92;partial &#92;rho = 0   ' class='latex' /> </p>
<p>for every <img src='https://s0.wp.com/latex.php?latex=%5Crho+%5Cin+%5Cmathbb%7BR%7D%5ET.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;rho &#92;in &#92;mathbb{R}^T.' title='&#92;rho &#92;in &#92;mathbb{R}^T.' class='latex' />  In other words&#8212;using some basic concepts from linear algebra&#8212;a reaction network has deficiency zero iff <img src='https://s0.wp.com/latex.php?latex=Y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Y' title='Y' class='latex' /> is one-to-one when restricted to the image of <img src='https://s0.wp.com/latex.php?latex=%5Cpartial.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;partial.' title='&#92;partial.' class='latex' />  Remember, the <a href="http://en.wikipedia.org/wiki/Image_%28mathematics%29">image</a> of <img src='https://s0.wp.com/latex.php?latex=%5Cpartial&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;partial' title='&#92;partial' class='latex' /> is </p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bim%7D+%5Cpartial+%3D+%5C%7B+%5Cpartial+%5Crho+%5C%3B+%3A+%5C%3B+%5Crho+%5Cin+%5Cmathbb%7BR%7D%5ET+%5C%7D+++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{im} &#92;partial = &#92;{ &#92;partial &#92;rho &#92;; : &#92;; &#92;rho &#92;in &#92;mathbb{R}^T &#92;}   ' title='&#92;mathrm{im} &#92;partial = &#92;{ &#92;partial &#92;rho &#92;; : &#92;; &#92;rho &#92;in &#92;mathbb{R}^T &#92;}   ' class='latex' /> </p>
<p>Roughly speaking, this consists of all changes in complexes that can occur due to reactions. </p>
<p>In still other words, a reaction network has deficiency zero if 0 is the only vector in both the image of <img src='https://s0.wp.com/latex.php?latex=%5Cpartial&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;partial' title='&#92;partial' class='latex' /> and the kernel of <img src='https://s0.wp.com/latex.php?latex=Y%3A&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Y:' title='Y:' class='latex' /></p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bim%7D+%5Cpartial+%5Ccap+%5Cmathrm%7Bker%7D+Y+%3D+%5C%7B+0+%5C%7D+++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{im} &#92;partial &#92;cap &#92;mathrm{ker} Y = &#92;{ 0 &#92;}   ' title='&#92;mathrm{im} &#92;partial &#92;cap &#92;mathrm{ker} Y = &#92;{ 0 &#92;}   ' class='latex' /> </p>
<p>Remember, the <a href="http://en.wikipedia.org/wiki/Kernel_%28mathematics%29">kernel</a> of <img src='https://s0.wp.com/latex.php?latex=Y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Y' title='Y' class='latex' /> is</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bker%7D+Y+%3D+%5C%7B+%5Cphi+%5Cin+%5Cmathbb%7BR%7D%5EK+%3A+Y+%5Cphi+%3D+0+%5C%7D++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{ker} Y = &#92;{ &#92;phi &#92;in &#92;mathbb{R}^K : Y &#92;phi = 0 &#92;}  ' title='&#92;mathrm{ker} Y = &#92;{ &#92;phi &#92;in &#92;mathbb{R}^K : Y &#92;phi = 0 &#92;}  ' class='latex' /> </p>
<p>Roughly speaking, this consists of all changes in complexes that don&#8217;t cause changes in species.  So, &#8216;deficiency zero&#8217; roughly says that if a reaction causes a change in complexes, it causes a change in species.  </p>
<p>(All this &#8216;roughly speaking&#8217; stuff is because in reality I should be talking about <i>linear combinations</i> of transitions, complexes and species.  But it&#8217;s a bit distracting to keep saying that when I&#8217;m trying to get across the basic ideas!)</p>
<p>Now we&#8217;re ready to understand deficiencies other than zero, at least a little.  They&#8217;re defined like this:</p>
<p><b> Definition.</b>  The <b>deficiency</b> of a reaction network is the dimension of <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bim%7D+%5Cpartial+%5Ccap+%5Cmathrm%7Bker%7D+Y.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{im} &#92;partial &#92;cap &#92;mathrm{ker} Y.' title='&#92;mathrm{im} &#92;partial &#92;cap &#92;mathrm{ker} Y.' class='latex' />  </p>
<h3>  How to compute the deficiency </h3>
<p>You can compute the deficiency of a reaction network just by looking at it.  However, it takes a little training.  First, remember that a reaction network can be drawn as a graph with complexes as vertices and transitions as edges, like this:</p>
<div align="center">
<img width="200" src="https://i1.wp.com/math.ucr.edu/home/baez/networks/chemical_reaction_network_part_20_I.png" alt="" />
</div>
<p>There are three important numbers we can extract from this graph:</p>
<p>&bull; We can count the number of vertices in this graph; let&#8217;s call that <img src='https://s0.wp.com/latex.php?latex=%7CK%7C%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='|K|,' title='|K|,' class='latex' /> since it&#8217;s just the number of complexes.  </p>
<p>&bull; We can count the number of pieces or &#8216;components&#8217; of this graph; let&#8217;s call that <img src='https://s0.wp.com/latex.php?latex=%5C%23+%5Cmathrm%7Bcomponents%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;# &#92;mathrm{components}' title='&#92;# &#92;mathrm{components}' class='latex' /> for now.  </p>
<p>&bull; We can also count the dimension of the image of <img src='https://s0.wp.com/latex.php?latex=Y+%5Cpartial.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Y &#92;partial.' title='Y &#92;partial.' class='latex' />  This space, <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bim%7D+Y+%5Cpartial%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{im} Y &#92;partial,' title='&#92;mathrm{im} Y &#92;partial,' class='latex' /> is called the <b>stochiometric subspace</b>: vectors in here are changes in species that can be accomplished by transitions in our reaction network, or linear combinations of transitions.  </p>
<p>These three numbers, all rather easy to compute, let us calculate the deficiency:</p>
<p><b> Theorem.</b> The deficiency of a reaction network equals </p>
<p><img src='https://s0.wp.com/latex.php?latex=%7CK%7C+-+%5C%23+%5Cmathrm%7Bcomponents%7D+-+%5Cmathrm%7Bdim%7D+%5Cleft%28+%5Cmathrm%7Bim%7D+Y+%5Cpartial+%5Cright%29++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='|K| - &#92;# &#92;mathrm{components} - &#92;mathrm{dim} &#92;left( &#92;mathrm{im} Y &#92;partial &#92;right)  ' title='|K| - &#92;# &#92;mathrm{components} - &#92;mathrm{dim} &#92;left( &#92;mathrm{im} Y &#92;partial &#92;right)  ' class='latex' /> </p>
<p><i>Proof.</i>   By definition we have</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bdeficiency%7D+%3D+%5Cdim+%5Cleft%28+%5Cmathrm%7Bim%7D+%5Cpartial+%5Ccap+%5Cmathrm%7Bker%7D+Y+%5Cright%29++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{deficiency} = &#92;dim &#92;left( &#92;mathrm{im} &#92;partial &#92;cap &#92;mathrm{ker} Y &#92;right)  ' title='&#92;mathrm{deficiency} = &#92;dim &#92;left( &#92;mathrm{im} &#92;partial &#92;cap &#92;mathrm{ker} Y &#92;right)  ' class='latex' /> </p>
<p>but another way to say this is</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bdeficiency%7D+%3D+%5Cmathrm%7Bdim%7D+%28%5Cmathrm%7Bker%7D+Y%7C_%7B%5Cmathrm%7Bim%7D+%5Cpartial%7D%29++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{deficiency} = &#92;mathrm{dim} (&#92;mathrm{ker} Y|_{&#92;mathrm{im} &#92;partial})  ' title='&#92;mathrm{deficiency} = &#92;mathrm{dim} (&#92;mathrm{ker} Y|_{&#92;mathrm{im} &#92;partial})  ' class='latex' /> </p>
<p>where we are restricting <img src='https://s0.wp.com/latex.php?latex=Y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Y' title='Y' class='latex' /> to the subspace <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bim%7D+%5Cpartial%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{im} &#92;partial,' title='&#92;mathrm{im} &#92;partial,' class='latex' /> and taking the dimension of the kernel of that.</p>
<p>The <a href="http://en.wikipedia.org/wiki/Rank%E2%80%93nullity_theorem"><b>rank-nullity theorem</b></a> says that whenever you have a linear map <img src='https://s0.wp.com/latex.php?latex=T%3A+V+%5Cto+W&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='T: V &#92;to W' title='T: V &#92;to W' class='latex' /> between finite-dimensional vector spaces, then</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bdim%7D+%5Cleft%28%5Cmathrm%7Bker%7D+T+%5Cright%29+%5C%3B+%3D+%5C%3B+%5Cmathrm%7Bdim%7D%5Cleft%28%5Cmathrm%7Bdom%7D+T%5Cright%29+%5C%3B+-+%5C%3B+%5Cmathrm%7Bdim%7D+%5Cleft%28%5Cmathrm%7Bim%7D+T%5Cright%29++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{dim} &#92;left(&#92;mathrm{ker} T &#92;right) &#92;; = &#92;; &#92;mathrm{dim}&#92;left(&#92;mathrm{dom} T&#92;right) &#92;; - &#92;; &#92;mathrm{dim} &#92;left(&#92;mathrm{im} T&#92;right)  ' title='&#92;mathrm{dim} &#92;left(&#92;mathrm{ker} T &#92;right) &#92;; = &#92;; &#92;mathrm{dim}&#92;left(&#92;mathrm{dom} T&#92;right) &#92;; - &#92;; &#92;mathrm{dim} &#92;left(&#92;mathrm{im} T&#92;right)  ' class='latex' /> </p>
<p>where <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bdom%7D+T&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{dom} T' title='&#92;mathrm{dom} T' class='latex' /> is the <a href="http://en.wikipedia.org/wiki/Domain_of_a_function">domain</a> of <img src='https://s0.wp.com/latex.php?latex=T%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='T,' title='T,' class='latex' /> namely the vector space <img src='https://s0.wp.com/latex.php?latex=V.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='V.' title='V.' class='latex' />  It follows that</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bdim%7D%28%5Cmathrm%7Bker%7D+Y%7C_%7B%5Cmathrm%7Bim%7D+%5Cpartial%7D%29+%3D+%5Cmathrm%7Bdim%7D%28%5Cmathrm%7Bdom%7D++Y%7C_%7B%5Cmathrm%7Bim%7D+%5Cpartial%7D%29+-+%5Cmathrm%7Bdim%7D%28%5Cmathrm%7Bim%7D++Y%7C_%7B%5Cmathrm%7Bim%7D+%5Cpartial%7D%29++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{dim}(&#92;mathrm{ker} Y|_{&#92;mathrm{im} &#92;partial}) = &#92;mathrm{dim}(&#92;mathrm{dom}  Y|_{&#92;mathrm{im} &#92;partial}) - &#92;mathrm{dim}(&#92;mathrm{im}  Y|_{&#92;mathrm{im} &#92;partial})  ' title='&#92;mathrm{dim}(&#92;mathrm{ker} Y|_{&#92;mathrm{im} &#92;partial}) = &#92;mathrm{dim}(&#92;mathrm{dom}  Y|_{&#92;mathrm{im} &#92;partial}) - &#92;mathrm{dim}(&#92;mathrm{im}  Y|_{&#92;mathrm{im} &#92;partial})  ' class='latex' /> </p>
<p>The domain of <img src='https://s0.wp.com/latex.php?latex=Y%7C_%7B%5Cmathrm%7Bim%7D+%5Cpartial%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Y|_{&#92;mathrm{im} &#92;partial}' title='Y|_{&#92;mathrm{im} &#92;partial}' class='latex' /> is just <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bim%7D+%5Cpartial%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{im} &#92;partial,' title='&#92;mathrm{im} &#92;partial,' class='latex' /> while its image equals <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bim%7D+Y+%5Cpartial%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{im} Y &#92;partial,' title='&#92;mathrm{im} Y &#92;partial,' class='latex' /> so</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bdeficiency%7D+%3D+%5Cmathrm%7Bdim%7D%28%5Cmathrm%7Bim%7D+%5Cpartial%29+-+%5Cmathrm%7Bdim%7D%28%5Cmathrm%7Bim%7D+Y+%5Cpartial%29+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{deficiency} = &#92;mathrm{dim}(&#92;mathrm{im} &#92;partial) - &#92;mathrm{dim}(&#92;mathrm{im} Y &#92;partial) ' title='&#92;mathrm{deficiency} = &#92;mathrm{dim}(&#92;mathrm{im} &#92;partial) - &#92;mathrm{dim}(&#92;mathrm{im} Y &#92;partial) ' class='latex' /></p>
<p>The theorem then follows from this:</p>
<p><b> Lemma.</b>  <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bdim%7D+%28%5Cmathrm%7Bim%7D+%5Cpartial%29+%3D+%7CK%7C+-+%5C%23+%5Cmathrm%7Bcomponents%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{dim} (&#92;mathrm{im} &#92;partial) = |K| - &#92;# &#92;mathrm{components} ' title='&#92;mathrm{dim} (&#92;mathrm{im} &#92;partial) = |K| - &#92;# &#92;mathrm{components} ' class='latex' /></p>
<p><i>Proof.</i>  In fact this holds whenever we have a finite set of complexes and a finite set of transitions going between them.  We get a diagram</p>
<div align="center">
<img src="https://i2.wp.com/math.ucr.edu/home/baez/networks/markov_process_diagram_3.png" alt="" />
</div>
<p>We can extend the source and target functions to linear maps as usual:</p>
<div align="center">
<img src="https://i0.wp.com/math.ucr.edu/home/baez/networks/markov_process_diagram_4.png" alt="" />
</div>
<p>and then we can define <img src='https://s0.wp.com/latex.php?latex=%5Cpartial+%3D+t+-+s.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;partial = t - s.' title='&#92;partial = t - s.' class='latex' />  We claim that </p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bdim%7D+%28%5Cmathrm%7Bim%7D+%5Cpartial%29+%3D+%7CK%7C+-+%5C%23+%5Cmathrm%7Bcomponents%7D++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{dim} (&#92;mathrm{im} &#92;partial) = |K| - &#92;# &#92;mathrm{components}  ' title='&#92;mathrm{dim} (&#92;mathrm{im} &#92;partial) = |K| - &#92;# &#92;mathrm{components}  ' class='latex' /> </p>
<p>where <img src='https://s0.wp.com/latex.php?latex=%5C%23+%5Cmathrm%7Bcomponents%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;# &#92;mathrm{components}' title='&#92;# &#92;mathrm{components}' class='latex' /> is the number of connected components of the graph with <img src='https://s0.wp.com/latex.php?latex=K&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='K' title='K' class='latex' /> as vertices and <img src='https://s0.wp.com/latex.php?latex=T&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='T' title='T' class='latex' /> as edges.  </p>
<p>This is easiest to see using an inductive argument where we start by throwing out all the edges of our graph and then put them back in one at a time.  When our graph has no edges, <img src='https://s0.wp.com/latex.php?latex=%5Cpartial+%3D+0&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;partial = 0' title='&#92;partial = 0' class='latex' /> and the number of components is <img src='https://s0.wp.com/latex.php?latex=%7CK%7C%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='|K|,' title='|K|,' class='latex' /> so our claim holds: both sides of the equation above are zero.  Then, each time we put in an edge, there are two choices: either it goes between two different components of the graph we have built so far, or it doesn&#8217;t.  If goes between two different components, it increases <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bdim%7D+%28%5Cmathrm%7Bim%7D+%5Cpartial%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{dim} (&#92;mathrm{im} &#92;partial)' title='&#92;mathrm{dim} (&#92;mathrm{im} &#92;partial)' class='latex' /> by 1 and decreases the number of components by 1, so our equation continues to hold.   If it doesn&#8217;t, neither of these quantities change, so our equation again continues to hold.   &nbsp;  &#9608;</p>
<h3> Examples </h3>
<div align="center">
<img width="200" src="https://i2.wp.com/math.ucr.edu/home/baez/networks/chemical_reaction_network_part_17_I.png" alt="" />
</div>
<p>This reaction network is not weakly reversible, since we can get from <img src='https://s0.wp.com/latex.php?latex=B+%2B+E&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='B + E' title='B + E' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=A+%2B+C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='A + C' title='A + C' class='latex' /> to <img src='https://s0.wp.com/latex.php?latex=D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='D' title='D' class='latex' /> but not back.   It becomes weakly reversible if we throw in another transition:</p>
<div align="center">
<img width="200" src="https://i2.wp.com/math.ucr.edu/home/baez/networks/chemical_reaction_network_part_17_II.png" alt="" />
</div>
<p>Taking a reaction network and throwing in the reverse of an existing transition never changes the number of complexes, the number of components, or the dimension of the stoichiometric subspace.  So, the deficiency of the reaction network remains unchanged.  We computed it back in <a href="http://math.ucr.edu/home/baez/networks/networks_17.html">Part 17</a>.  For either reaction network above:</p>
<p>&bull; the number of complexes is 5:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%7CK%7C+%3D+%7C%5C%7BA%2CB%2CD%2C+A%2BC%2C+B%2BE%5C%7D%7C+%3D+5++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='|K| = |&#92;{A,B,D, A+C, B+E&#92;}| = 5  ' title='|K| = |&#92;{A,B,D, A+C, B+E&#92;}| = 5  ' class='latex' /> </p>
<p>&bull; the number of components is 2:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5C%23+%5Cmathrm%7Bcomponents%7D+%3D+2++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;# &#92;mathrm{components} = 2  ' title='&#92;# &#92;mathrm{components} = 2  ' class='latex' /> </p>
<p>&bull; the dimension of the stoichiometric subspace is 3.  For this we go through each transition, see what change in species it causes, and take the vector space spanned by these changes.  Then we find a basis for this space and count it:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bim%7D+Y+%5Cpartial+%3D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{im} Y &#92;partial = ' title='&#92;mathrm{im} Y &#92;partial = ' class='latex' /> </p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Clangle+B+-+A%2C+A+-+B%2C+D+-+A+-+C%2C+D+-+%28B%2BE%29+%2C++%28B%2BE%29-%28A%2BC%29+%5Crangle++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;langle B - A, A - B, D - A - C, D - (B+E) ,  (B+E)-(A+C) &#92;rangle  ' title='&#92;langle B - A, A - B, D - A - C, D - (B+E) ,  (B+E)-(A+C) &#92;rangle  ' class='latex' /></p>
<p><img src='https://s0.wp.com/latex.php?latex=%3D+%5Clangle+B+-A%2C+D+-+A+-+C%2C+D+-+A+-+E+%5Crangle++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='= &#92;langle B -A, D - A - C, D - A - E &#92;rangle  ' title='= &#92;langle B -A, D - A - C, D - A - E &#92;rangle  ' class='latex' /></p>
<p>so </p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bdim%7D+%5Cleft%28%5Cmathrm%7Bim%7D+Y+%5Cpartial+%5Cright%29+%3D+3++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{dim} &#92;left(&#92;mathrm{im} Y &#92;partial &#92;right) = 3  ' title='&#92;mathrm{dim} &#92;left(&#92;mathrm{im} Y &#92;partial &#92;right) = 3  ' class='latex' /> </p>
<p>As a result, the deficiency is zero:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Bccl%7D+%5Cmathrm%7Bdeficiency%7D+++%26%3D%26+%7CK%7C+-+%5C%23+%5Cmathrm%7Bcomponents%7D+-+%5Cmathrm%7Bdim%7D+%5Cleft%28+%5Cmathrm%7Bim%7D+Y+%5Cpartial+%5Cright%29+%5C%5C++%26%3D%26+5+-+2+-+3+%5C%5C++%26%3D%26++0+%5Cend%7Barray%7D++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;begin{array}{ccl} &#92;mathrm{deficiency}   &amp;=&amp; |K| - &#92;# &#92;mathrm{components} - &#92;mathrm{dim} &#92;left( &#92;mathrm{im} Y &#92;partial &#92;right) &#92;&#92;  &amp;=&amp; 5 - 2 - 3 &#92;&#92;  &amp;=&amp;  0 &#92;end{array}  ' title='&#92;begin{array}{ccl} &#92;mathrm{deficiency}   &amp;=&amp; |K| - &#92;# &#92;mathrm{components} - &#92;mathrm{dim} &#92;left( &#92;mathrm{im} Y &#92;partial &#92;right) &#92;&#92;  &amp;=&amp; 5 - 2 - 3 &#92;&#92;  &amp;=&amp;  0 &#92;end{array}  ' class='latex' /> </p>
<p>Now let&#8217;s throw in another complex and some more transitions:</p>
<div align="center">
<img width="200" src="https://i0.wp.com/math.ucr.edu/home/baez/networks/chemical_reaction_network_part_20_II.png" alt="" />
</div>
<p>Now:</p>
<p>&bull; the number of complexes increases by 1:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%7CK%7C+%3D+%7C%5C%7BA%2CB%2CD%2CE%2C+A%2BC%2C+B%2BE%5C%7D%7C+%3D+6++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='|K| = |&#92;{A,B,D,E, A+C, B+E&#92;}| = 6  ' title='|K| = |&#92;{A,B,D,E, A+C, B+E&#92;}| = 6  ' class='latex' /> </p>
<p>&bull; the number of components is unchanged:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5C%23+%5Cmathrm%7Bcomponents%7D+%3D+2++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;# &#92;mathrm{components} = 2  ' title='&#92;# &#92;mathrm{components} = 2  ' class='latex' /> </p>
<p>&bull; the dimension of the stoichiometric subspace increases by 1.  We never need to include reverses of transitions when computing this:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bim%7D+Y+%5Cpartial+%3D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{im} Y &#92;partial = ' title='&#92;mathrm{im} Y &#92;partial = ' class='latex' /> </p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Clangle+B-A%2C+E-B%2C++D+-+%28A%2BC%29%2C+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;langle B-A, E-B,  D - (A+C), ' title='&#92;langle B-A, E-B,  D - (A+C), ' class='latex' /><br />
<img src='https://s0.wp.com/latex.php?latex=D+-+%28B%2BE%29+%2C+%28B%2BE%29-%28A%2BC%29+%5Crangle++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='D - (B+E) , (B+E)-(A+C) &#92;rangle  ' title='D - (B+E) , (B+E)-(A+C) &#92;rangle  ' class='latex' /></p>
<p><img src='https://s0.wp.com/latex.php?latex=%3D+%5Clangle+B+-A%2C+E-B%2C+D+-+A+-+C%2C+D+-+B+-+E+%5Crangle++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='= &#92;langle B -A, E-B, D - A - C, D - B - E &#92;rangle  ' title='= &#92;langle B -A, E-B, D - A - C, D - B - E &#92;rangle  ' class='latex' /></p>
<p>so </p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bdim%7D+%5Cleft%28%5Cmathrm%7Bim%7D+Y+%5Cpartial+%5Cright%29+%3D+4++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{dim} &#92;left(&#92;mathrm{im} Y &#92;partial &#92;right) = 4  ' title='&#92;mathrm{dim} &#92;left(&#92;mathrm{im} Y &#92;partial &#92;right) = 4  ' class='latex' /> </p>
<p>As a result, the deficiency is still zero:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Bccl%7D+%5Cmathrm%7Bdeficiency%7D+++%26%3D%26+%7CK%7C+-+%5C%23+%5Cmathrm%7Bcomponents%7D+-+%5Cmathrm%7Bdim%7D+%5Cleft%28+%5Cmathrm%7Bim%7D+Y+%5Cpartial+%5Cright%29+%5C%5C++%26%3D%26+6+-+2+-+4+%5C%5C++%26%3D%26++0+%5Cend%7Barray%7D++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;begin{array}{ccl} &#92;mathrm{deficiency}   &amp;=&amp; |K| - &#92;# &#92;mathrm{components} - &#92;mathrm{dim} &#92;left( &#92;mathrm{im} Y &#92;partial &#92;right) &#92;&#92;  &amp;=&amp; 6 - 2 - 4 &#92;&#92;  &amp;=&amp;  0 &#92;end{array}  ' title='&#92;begin{array}{ccl} &#92;mathrm{deficiency}   &amp;=&amp; |K| - &#92;# &#92;mathrm{components} - &#92;mathrm{dim} &#92;left( &#92;mathrm{im} Y &#92;partial &#92;right) &#92;&#92;  &amp;=&amp; 6 - 2 - 4 &#92;&#92;  &amp;=&amp;  0 &#92;end{array}  ' class='latex' /> </p>
<p>Do <i>all</i> reaction networks have deficiency zero?   That would be nice. Let&#8217;s try one more example:</p>
<div align="center">
<img width="200" src="https://i2.wp.com/math.ucr.edu/home/baez/networks/chemical_reaction_network_part_20_V.png" alt="" />
</div>
<p>&bull; the number of complexes is the same as in our last example:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%7CK%7C+%3D+%7C%5C%7BA%2CB%2CD%2CE%2C+A%2BC%2C+B%2BE%5C%7D%7C+%3D+6++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='|K| = |&#92;{A,B,D,E, A+C, B+E&#92;}| = 6  ' title='|K| = |&#92;{A,B,D,E, A+C, B+E&#92;}| = 6  ' class='latex' /> </p>
<p>&bull; the number of components is also the same:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5C%23+%5Cmathrm%7Bcomponents%7D+%3D+2++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;# &#92;mathrm{components} = 2  ' title='&#92;# &#92;mathrm{components} = 2  ' class='latex' /> </p>
<p>&bull; the dimension of the stoichiometric subspace is also the same:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bim%7D+Y+%5Cpartial+%3D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{im} Y &#92;partial = ' title='&#92;mathrm{im} Y &#92;partial = ' class='latex' /> </p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Clangle+B-A%2C++D+-+%28A%2BC%29%2C+D+-+%28B%2BE%29+%2C+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;langle B-A,  D - (A+C), D - (B+E) , ' title='&#92;langle B-A,  D - (A+C), D - (B+E) , ' class='latex' /><br />
<img src='https://s0.wp.com/latex.php?latex=%28B%2BE%29-%28A%2BC%29%2C+%28B%2BE%29+-+B+%5Crangle+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='(B+E)-(A+C), (B+E) - B &#92;rangle ' title='(B+E)-(A+C), (B+E) - B &#92;rangle ' class='latex' /></p>
<p><img src='https://s0.wp.com/latex.php?latex=%3D+%5Clangle+B+-A%2C+D+-+A+-+C%2C+D+-+B+%2C+E%5Crangle+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='= &#92;langle B -A, D - A - C, D - B , E&#92;rangle ' title='= &#92;langle B -A, D - A - C, D - B , E&#92;rangle ' class='latex' /> </p>
<p>so </p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7Bdim%7D+%5Cleft%28%5Cmathrm%7Bim%7D+Y+%5Cpartial+%5Cright%29+%3D+4++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{dim} &#92;left(&#92;mathrm{im} Y &#92;partial &#92;right) = 4  ' title='&#92;mathrm{dim} &#92;left(&#92;mathrm{im} Y &#92;partial &#92;right) = 4  ' class='latex' /> </p>
<p>So the deficiency is still zero:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Bccl%7D+%5Cmathrm%7Bdeficiency%7D+++%26%3D%26+%7CK%7C+-+%5C%23+%5Cmathrm%7Bcomponents%7D+-+%5Cmathrm%7Bdim%7D+%5Cleft%28+%5Cmathrm%7Bim%7D+Y+%5Cpartial+%5Cright%29+%5C%5C++%26%3D%26+6+-+2+-+4+%5C%5C++%26%3D%26++0+%5Cend%7Barray%7D++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;begin{array}{ccl} &#92;mathrm{deficiency}   &amp;=&amp; |K| - &#92;# &#92;mathrm{components} - &#92;mathrm{dim} &#92;left( &#92;mathrm{im} Y &#92;partial &#92;right) &#92;&#92;  &amp;=&amp; 6 - 2 - 4 &#92;&#92;  &amp;=&amp;  0 &#92;end{array}  ' title='&#92;begin{array}{ccl} &#92;mathrm{deficiency}   &amp;=&amp; |K| - &#92;# &#92;mathrm{components} - &#92;mathrm{dim} &#92;left( &#92;mathrm{im} Y &#92;partial &#92;right) &#92;&#92;  &amp;=&amp; 6 - 2 - 4 &#92;&#92;  &amp;=&amp;  0 &#92;end{array}  ' class='latex' /> </p>
<p>It&#8217;s sure easy to find examples with deficiency zero!  </p>
<p><b> Puzzle 1.</b> Can you find an example where the deficiency is <i>not</i> zero?</p>
<p><b>Puzzle 2.</b>  If you can&#8217;t find an example, prove the deficiency is always zero. If you can, find 1) the smallest example and 2) the smallest example that actually arises in chemistry.  </p>
<p>Note that not all reaction networks can actually arise in chemistry.  For example, the transition $A \to A + A$ would violate conservation of mass.  Nonetheless a reaction network like this might be useful in a very simple model of amoeba reproduction, one that doesn&#8217;t take limited resources into account.</p>
<h3> Different kinds of graphs </h3>
<p>I&#8217;ll conclude with some technical remarks that only a mathematician could love; feel free to skip them if you&#8217;re not in the mood.  As you&#8217;ve already seen, it&#8217;s important that a reaction network can be drawn as a graph:</p>
<div align="center">
<img width="200" src="https://i2.wp.com/math.ucr.edu/home/baez/networks/chemical_reaction_network_part_17_II.png" alt="" />
</div>
<p>But there are many <i>kinds</i> of graph.  What kind of graph is this, exactly?  </p>
<p>As I mentioned in <a href="http://math.ucr.edu/home/baez/networks/networks_17.html">Part 17</a>, it&#8217;s a <b>directed multigraph</b>, meaning that the edges have arrows on them, more than one edge can go from one vertex to another, and we can have any number of edges going from a vertex to itself.  Not all those features are present in this example, but they&#8217;re certainly allowed by our definition of reaction network!  </p>
<p>After all, we&#8217;ve seen that a stochastic reaction network amounts to a little diagram like this:</p>
<div align="center">
<img src="https://i1.wp.com/math.ucr.edu/home/baez/networks/reaction_network_diagram_1.png" alt="" />
</div>
<p>If we throw out the rate constants, we&#8217;re left with a reaction network.  So, a reaction network is just a diagram like this:</p>
<div align="center">
<img src="https://i1.wp.com/math.ucr.edu/home/baez/networks/reaction_network_diagram_4.png" alt="" />
</div>
<p>If we throw out the information about how complexes are made of species, we&#8217;re left with an even smaller diagram:</p>
<div align="center">
<img src="https://i2.wp.com/math.ucr.edu/home/baez/networks/markov_process_diagram_3.png" alt="" />
</div>
<p>And this precisely matches the slick definition of a <b>directed multigraph</b>: it&#8217;s a set <img src='https://s0.wp.com/latex.php?latex=E&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='E' title='E' class='latex' /> of <b>edges</b>, a set <img src='https://s0.wp.com/latex.php?latex=V&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='V' title='V' class='latex' /> of <b>vertices</b>, and functions <img src='https://s0.wp.com/latex.php?latex=s%2Ct+%3A+E+%5Cto+V&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s,t : E &#92;to V' title='s,t : E &#92;to V' class='latex' /> saying where each edge starts and where it ends: its <b>source</b> and <b>target</b>.  </p>
<p>Since this series is about networks, we should expect to run into many kinds of graphs.  While their diversity is a bit annoying at first, we must learn to love it, at least if we&#8217;re mathematicians and want everything to be completely precise.   </p>
<p>There are at least 2<sup>3</sup> = 8 kinds of graphs, depending on our answers to three questions:</p>
<p>&bull; Do the edges have arrows on them?</p>
<p>&bull; Can more than one edge can go between a specific pair of vertices?</p>
<p>and</p>
<p>&bull; Can an edge can go from a vertex to itself?</p>
<p>We get directed multigraphs if we answer YES, YES and YES to these questions.  Since they allow all three features, directed multigraphs are very important.  For example, a <i>category</i> is a directed multigraph equipped with some extra structure.  Also, what mathematicians call a <i>quiver</i> is just another name for a directed multigraph.</p>
<p>We&#8217;ve met two other kinds of graph so far:</p>
<p>&bull; In <a href="http://math.ucr.edu/home/baez/networks/networks_15.html">Part 15</a> and <a href="http://math.ucr.edu/home/baez/networks/networks_16.html">Part 16</a> we described circuits made of resistors&mdash;or, in other words, Dirichlet operators&mdash;using &#8216;simple graphs&#8217;.  We get simple graphs when we answer NO, NO and NO to the three questions above.   The slick definition of a <b>simple graph</b> is that it&#8217;s a set <img src='https://s0.wp.com/latex.php?latex=V&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='V' title='V' class='latex' /> of vertices together with a subset <img src='https://s0.wp.com/latex.php?latex=E&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='E' title='E' class='latex' /> of the collection of 2-element subsets of <img src='https://s0.wp.com/latex.php?latex=V&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='V' title='V' class='latex' />.</p>
<p>&bull;  In <a href="http://math.ucr.edu/home/baez/networks/networks_20.html">Part 20</a> we described Markov processes on finite sets&mdash;or, in other words, infinitesimal stochastic operators&mdash;using &#8216;directed graphs&#8217;.  We get directed graphs when we answer YES, NO and YES to the three questions.  The slick definition of a <b>directed graph</b> is that it&#8217;s a set <img src='https://s0.wp.com/latex.php?latex=V&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='V' title='V' class='latex' /> of vertices together with a subset <img src='https://s0.wp.com/latex.php?latex=E&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='E' title='E' class='latex' /> of the ordered pairs of <img src='https://s0.wp.com/latex.php?latex=V&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='V' title='V' class='latex' />:  <img src='https://s0.wp.com/latex.php?latex=E+%5Csubseteq+V+%5Ctimes+V&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='E &#92;subseteq V &#92;times V' title='E &#92;subseteq V &#92;times V' class='latex' />.  </p>
<p>There is a lot to say about this business, but for now I&#8217;ll just note that you can use directed multigraphs with edges labelled by positive numbers to describe Markov processes, just as we used directed graphs.  You don&#8217;t get anything more general, though!  After all, if we have multiple edges from one vertex to another, we can replace them by a single edge as long as we add up their rate constants.  And an edge from a vertex to itself has no effect at all.</p>
<p>In short, both for Markov processes and reaction networks, we can take &#8216;graph&#8217; to mean either &#8216;directed graph&#8217; or &#8216;directed multigraph&#8217;, as long as we make some minor adjustments. In what follows, we&#8217;ll use directed multigraphs for <i>both</i> Markov processes and reaction networks.  It will work a bit better if we ever get around to explaining how category theory fits into this story.</p>
]]></html><thumbnail_url><![CDATA[https://i2.wp.com/math.ucr.edu/home/baez/networks/chemical_reaction_network_part_20_V.png?fit=440%2C330]]></thumbnail_url><thumbnail_height><![CDATA[204]]></thumbnail_height><thumbnail_width><![CDATA[267]]></thumbnail_width></oembed>