<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/default.xsl"?>
<fr:tree xmlns:fr="http://www.forester-notes.org" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xml="http://www.w3.org/XML/1998/namespace" root="false" base-url="/">
  <fr:frontmatter>
    <fr:authors>
      <fr:author>
        <fr:link href="/eigil-rischel/" title="Eigil Fjeldgren Rischel" uri="https://erischel.com/eigil-rischel/" display-uri="eigil-rischel" type="local">Eigil Fjeldgren Rischel</fr:link>
      </fr:author>
    </fr:authors>
    <fr:date>
      <fr:year>2021</fr:year>
      <fr:month>6</fr:month>
      <fr:day>19</fr:day>
    </fr:date>
    <fr:uri>https://erischel.com/20210618162423-martin_lof_random_sequences/</fr:uri>
    <fr:display-uri>20210618162423-martin_lof_random_sequences</fr:display-uri>
    <fr:route>/20210618162423-martin_lof_random_sequences/</fr:route>
    <fr:title text="Martin-Löf Random Sequences">Martin-Löf Random Sequences</fr:title>
  </fr:frontmatter>
  <fr:mainmatter>
    <html:p>
A sequence of bits <fr:tex display="inline"><![CDATA[N \to  \{0,1\}]]></fr:tex> is _Martin-Löf random_ (or _algorithmically random_) if, roughly speaking, there is no _computable_ pattern to it.
</html:p>
    <html:p>
There are three equivalent definitions:
</html:p>
    <fr:tree show-metadata="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="/eigil-rischel/" title="Eigil Fjeldgren Rischel" uri="https://erischel.com/eigil-rischel/" display-uri="eigil-rischel" type="local">Eigil Fjeldgren Rischel</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2021</fr:year>
          <fr:month>6</fr:month>
          <fr:day>19</fr:day>
        </fr:date>
        <fr:title text="Kolmogorov complexity definition">Kolmogorov complexity definition</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>
  Let <fr:tex display="inline"><![CDATA[K(x)]]></fr:tex> be the kolmogorov complexity of a binary string (finite).
  Say <fr:tex display="inline"><![CDATA[x]]></fr:tex> is <fr:tex display="inline"><![CDATA[c]]></fr:tex>-incompressible if <fr:tex display="inline"><![CDATA[K(x) \geq  |x| - c]]></fr:tex>. An infinite string is Martin-löf random if there exists <fr:tex display="inline"><![CDATA[c]]></fr:tex> so that all its finite prefixes are <fr:tex display="inline"><![CDATA[c]]></fr:tex>-incompressible.
</html:p>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="/eigil-rischel/" title="Eigil Fjeldgren Rischel" uri="https://erischel.com/eigil-rischel/" display-uri="eigil-rischel" type="local">Eigil Fjeldgren Rischel</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2021</fr:year>
          <fr:month>6</fr:month>
          <fr:day>19</fr:day>
        </fr:date>
        <fr:title text="Constructive &quot;covers&quot;">Constructive "covers"</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>
  Given a finite string <fr:tex display="inline"><![CDATA[w]]></fr:tex>, <fr:tex display="inline"><![CDATA[C_w]]></fr:tex> is the open set of strings with that prefix.
  A constructive open is an open given as the union of an enumerable sequence of such things.
  A constructive nullcover is a computable sequence <fr:tex display="inline"><![CDATA[U_i \supset  U_{i+1}]]></fr:tex> of constructive opens so that <fr:tex display="inline"><![CDATA[\mu (U_i) \leq  2^i]]></fr:tex> (<fr:tex display="inline"><![CDATA[\mu ]]></fr:tex> being the obvious "lebesgue" measure on Cantor space).
  A sequence <fr:tex display="inline"><![CDATA[x]]></fr:tex> is Martin-Löf random if, for any constructive nullcover, <fr:tex display="inline"><![CDATA[x \neq  \cup ^\infty  U_i]]></fr:tex>.
</html:p>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="/eigil-rischel/" title="Eigil Fjeldgren Rischel" uri="https://erischel.com/eigil-rischel/" display-uri="eigil-rischel" type="local">Eigil Fjeldgren Rischel</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2021</fr:year>
          <fr:month>6</fr:month>
          <fr:day>19</fr:day>
        </fr:date>
        <fr:title text="Constructive Martingales">Constructive Martingales</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>
  A _Martingale_ is a function <fr:tex display="inline"><![CDATA[\{0,1\}^* \to  [ 0,\infty  )]]></fr:tex>, interpreted as the profit of a betting strategy (betting on coinflips) on the given sequence of coinflip outcomes.
  It's _fair_ if <fr:tex display="inline"><![CDATA[m(x) = (m(x .0) + m(x.1))/2]]></fr:tex> - in other words, the amount you win on a zero must equal the amount you lose on a one. Ie "you're betting at fair odds".
</html:p>
        <html:p>
  A martingale _succeeds_ on a Martin-löf random sequence if its limsup on the prefixes is infinite - i.e if it wins unbounded amounts of money at fair odds without ever risking any more than its finite starting pot (since it cannot go negative).
</html:p>
        <html:p>
  A martingale is _constructive_ if it is "lower computable", and a sequence is Martin-Löf random if there is no constructive martingale that succeeds on it.
</html:p>
        <html:p>
  Ie if there is no computable gambling strategy to extract unbounded money from the assumption "this sequence produces fair coinflips".
</html:p>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="/eigil-rischel/" title="Eigil Fjeldgren Rischel" uri="https://erischel.com/eigil-rischel/" display-uri="eigil-rischel" type="local">Eigil Fjeldgren Rischel</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2021</fr:year>
          <fr:month>6</fr:month>
          <fr:day>19</fr:day>
        </fr:date>
        <fr:title text="Discussion">Discussion</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>
  In other words, as long as the world is computable, you can comfortably treat any Martin-löf sequence as random. Of course, if the world is computable, you cannot store one in any way, and any black box that outputs a Martin-Löf sequence is in some sense "either random or uncomputable".
</html:p>
        <html:p>
  So in some sense there's _no way_ of telling the difference between a deterministic, computable world that contains some black boxes that output Martin-Löf sequences, and a computable world that contains some black boxes that output "actually random" sequences.
  This provides some justification for the philosophical position that "randomness" is always about quantifying the limitations (of information, or in this case, of which functions they can compute) of the observer, advanced eg <fr:link href="https://www.lesswrong.com/posts/f6ZLxEWaankRZ2Crv/probability-is-in-the-mind" type="external">here</fr:link>.
</html:p>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="/eigil-rischel/" title="Eigil Fjeldgren Rischel" uri="https://erischel.com/eigil-rischel/" display-uri="eigil-rischel" type="local">Eigil Fjeldgren Rischel</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2021</fr:year>
          <fr:month>6</fr:month>
          <fr:day>19</fr:day>
        </fr:date>
        <fr:title text="Proof (sketches) of equivalence">Proof (sketches) of equivalence</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>
  Suppose <fr:tex display="inline"><![CDATA[x]]></fr:tex> belongs to some constructive nullcover, <fr:tex display="inline"><![CDATA[(U_n)]]></fr:tex>
  Then we can construct a constructive martingale which essentially makes the bet "<fr:tex display="inline"><![CDATA[x]]></fr:tex> will be in <fr:tex display="inline"><![CDATA[U_n]]></fr:tex>", continuously making a profit.
  Basically, assume we have already defined <fr:tex display="inline"><![CDATA[m(w)]]></fr:tex> for all the strings up to length <fr:tex display="inline"><![CDATA[k]]></fr:tex>,
  Consider a string <fr:tex display="inline"><![CDATA[w]]></fr:tex> of that length. Either both of <fr:tex display="inline"><![CDATA[w.0]]></fr:tex> and <fr:tex display="inline"><![CDATA[w.1]]></fr:tex> belong to <fr:tex display="inline"><![CDATA[U_k]]></fr:tex>, or neither, or exactly one of them.
  If neither do, then we know we're not looking at <fr:tex display="inline"><![CDATA[x]]></fr:tex>, so it doesn't matter.
  If both do, then we make no bet at this point, but use <fr:tex display="inline"><![CDATA[U_k]]></fr:tex> again to compure <fr:tex display="inline"><![CDATA[w.00, w.01]]></fr:tex> and so on.
  If only one of them do, then we bet all our money on that one.
  This martingale succeeds on <fr:tex display="inline"><![CDATA[x]]></fr:tex>, and is constructive because the <fr:tex display="inline"><![CDATA[U_n]]></fr:tex>s are.
</html:p>
        <html:p>
  On the other hand, suppose a constructive martingale <fr:tex display="inline"><![CDATA[m]]></fr:tex> succeeds on <fr:tex display="inline"><![CDATA[x]]></fr:tex>.
  Without loss of generality, assume <fr:tex display="inline"><![CDATA[m(\epsilon ) = 1]]></fr:tex>, where <fr:tex display="inline"><![CDATA[\epsilon ]]></fr:tex> is the empty string.
  Let <fr:tex display="inline"><![CDATA[U_n]]></fr:tex> be the set of strings where <fr:tex display="inline"><![CDATA[m(w) > 2^n]]></fr:tex> for some prefix.
  Clearly no fair betting strategy can get positive expected value, so the measure of <fr:tex display="inline"><![CDATA[U_n]]></fr:tex> is at most <fr:tex display="inline"><![CDATA[2^{-n}]]></fr:tex>. On the other hand <fr:tex display="inline"><![CDATA[U_n]]></fr:tex> is computable because <fr:tex display="inline"><![CDATA[m]]></fr:tex> is. This proves equivalence of the martingale and constructive nullcover definitions.
</html:p>
        <html:p>
  Now suppose <fr:tex display="inline"><![CDATA[x]]></fr:tex> is compressible, i.e the value <fr:tex display="inline"><![CDATA[n - K(x_n)]]></fr:tex> is unbounded.
  Then there exists a program which receives and infinite bitstring as input and produces output one bit at a time, and an input <fr:tex display="inline"><![CDATA[y]]></fr:tex>, so that when run with input <fr:tex display="inline"><![CDATA[y]]></fr:tex> it produces <fr:tex display="inline"><![CDATA[x]]></fr:tex> as output, and so that the difference between the number of input bits consumed and the number of output bits produced grows without bound (the input is just a suitable sequence of very effective compressions of <fr:tex display="inline"><![CDATA[x]]></fr:tex>. The program simulates these, then outputs the extra bits from the end).
  Note that given <fr:tex display="inline"><![CDATA[n]]></fr:tex>, we can compute <fr:tex display="inline"><![CDATA[k]]></fr:tex> so that, after consuming <fr:tex display="inline"><![CDATA[k]]></fr:tex> bits of input, the program produces <fr:tex display="inline"><![CDATA[n+k]]></fr:tex> bits of output.
  Then we can define <fr:tex display="inline"><![CDATA[U_n]]></fr:tex> to be the set of infinite strings that have a length <fr:tex display="inline"><![CDATA[n+k]]></fr:tex> prefix which is a possible output of the program on an input of length <fr:tex display="inline"><![CDATA[k]]></fr:tex>.
  There are at most <fr:tex display="inline"><![CDATA[2^k]]></fr:tex> such outputs, each of which determines a set of measure <fr:tex display="inline"><![CDATA[2^{-n-k}]]></fr:tex>, so this has measure <fr:tex display="inline"><![CDATA[2^{-n}]]></fr:tex>. But clearly <fr:tex display="inline"><![CDATA[n]]></fr:tex> is in there.
</html:p>
        <html:p>
  On the other hand, suppose <fr:tex display="inline"><![CDATA[x]]></fr:tex> is in some nullcover <fr:tex display="inline"><![CDATA[U_n]]></fr:tex>.
  Then we can try to compress the prefixes of <fr:tex display="inline"><![CDATA[x]]></fr:tex> as follows:
</html:p>
        <html:p>
  -   Compute the gödel number of the program enumerating the prefixes defining <fr:tex display="inline"><![CDATA[U_n]]></fr:tex>, for some <fr:tex display="inline"><![CDATA[n]]></fr:tex>
  -   Find the <fr:tex display="inline"><![CDATA[k]]></fr:tex>th output of this program, for some <fr:tex display="inline"><![CDATA[k]]></fr:tex>, which is necessarily a prefix of <fr:tex display="inline"><![CDATA[x]]></fr:tex>. We may assume wlog that this program produces its output in ascending order of length.
</html:p>
        <html:p>
  The length of this program is a constant <fr:tex display="inline"><![CDATA[c]]></fr:tex>, to store the program computing <fr:tex display="inline"><![CDATA[(U_n)]]></fr:tex> and for gluing code, plus <fr:tex display="inline"><![CDATA[\log  n + \log  k]]></fr:tex> bits to store <fr:tex display="inline"><![CDATA[n]]></fr:tex> and <fr:tex display="inline"><![CDATA[k]]></fr:tex>.
  Let <fr:tex display="inline"><![CDATA[l_i]]></fr:tex> be the length of the <fr:tex display="inline"><![CDATA[i]]></fr:tex>th prefix defining <fr:tex display="inline"><![CDATA[U_n]]></fr:tex>
  Then <fr:tex display="inline"><![CDATA[\sum _i 2^{-l_i} \leq  2^{-n}]]></fr:tex>.
  This implies that the <fr:tex display="inline"><![CDATA[l_i]]></fr:tex> is at least <fr:tex display="inline"><![CDATA[n + \log  i]]></fr:tex>.
  Hence this is a length <fr:tex display="inline"><![CDATA[c + \log  n + \log  k]]></fr:tex> program that produces a prefix of <fr:tex display="inline"><![CDATA[x]]></fr:tex> of length at least <fr:tex display="inline"><![CDATA[n + \log  k]]></fr:tex> - hence for <fr:tex display="inline"><![CDATA[n]]></fr:tex> large enough, this is an arbitrarily good compression.
</html:p>
      </fr:mainmatter>
    </fr:tree>
  </fr:mainmatter>
  <fr:backmatter>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="References">References</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Context">Context</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Backlinks">Backlinks</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Related">Related</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Contributions">Contributions</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
  </fr:backmatter>
</fr:tree>
