tag:theconversation.com,2011:/institutions/institute-for-advanced-study-2722/articlesInstitute for Advanced Study2016-09-19T01:23:03Ztag:theconversation.com,2011:article/599582016-09-19T01:23:03Z2016-09-19T01:23:03ZHow random is your randomness, and why does it matter?<figure><img src="https://images.theconversation.com/files/135969/original/image-20160830-26282-1tt17ym.jpg?ixlib=rb-4.1.0&q=45&auto=format&w=496&fit=clip" /><figcaption><span class="caption">What if the person flipping the coin cheats?</span> <span class="attribution"><a class="source" href="http://www.shutterstock.com/pic-60542725.html">Coin and hand via shutterstock.com</a></span></figcaption></figure><p>Randomness is powerful. Think about a presidential poll: A random sample of just 400 people in the United States can accurately estimate Clinton’s and Trump’s support to within 5 percent (with 95 percent certainty), despite the U.S. population exceeding 300 million. That’s just one of many uses.</p>
<p>Randomness is <a href="http://www.design-reuse.com/articles/27050/true-randomness-in-cryptography.html">vital for computer security</a>, making possible secure encryption that allows people to communicate secretly even if an adversary sees all coded messages. Surprisingly, it even allows security to be maintained <a href="https://math.berkeley.edu/%7Ekpmann/encryption.pdf">if the adversary also knows the key used to the encode the messages</a>.</p>
<p>Often random numbers can be used to speed up algorithms. For example, the fastest way we know to <a href="https://www.cs.cmu.edu/%7Eavrim/Randalgs97/lect0319">test whether a particular number is prime</a> involves choosing random numbers. That can be helpful in math, computer science and cryptography, among other disciplines.</p>
<p>Random numbers are also crucial to simulating very complex systems. When dealing with the climate or the economy, for example, so many factors interact in so many ways that the equations involve millions of variables. Today’s computers are not powerful enough to handle all these unknowns. <a href="http://dx.doi.org/10.1002/wics.1314">Modeling this complexity with random numbers</a> simplifies the calculations, and still results in accurate simulations.</p>
<figure class="align-left ">
<img alt="" src="https://images.theconversation.com/files/135976/original/image-20160830-28240-a825k0.jpg?ixlib=rb-4.1.0&q=45&auto=format&w=237&fit=clip" srcset="https://images.theconversation.com/files/135976/original/image-20160830-28240-a825k0.jpg?ixlib=rb-4.1.0&q=45&auto=format&w=600&h=338&fit=crop&dpr=1 600w, https://images.theconversation.com/files/135976/original/image-20160830-28240-a825k0.jpg?ixlib=rb-4.1.0&q=30&auto=format&w=600&h=338&fit=crop&dpr=2 1200w, https://images.theconversation.com/files/135976/original/image-20160830-28240-a825k0.jpg?ixlib=rb-4.1.0&q=15&auto=format&w=600&h=338&fit=crop&dpr=3 1800w, https://images.theconversation.com/files/135976/original/image-20160830-28240-a825k0.jpg?ixlib=rb-4.1.0&q=45&auto=format&w=754&h=424&fit=crop&dpr=1 754w, https://images.theconversation.com/files/135976/original/image-20160830-28240-a825k0.jpg?ixlib=rb-4.1.0&q=30&auto=format&w=754&h=424&fit=crop&dpr=2 1508w, https://images.theconversation.com/files/135976/original/image-20160830-28240-a825k0.jpg?ixlib=rb-4.1.0&q=15&auto=format&w=754&h=424&fit=crop&dpr=3 2262w" sizes="(min-width: 1466px) 754px, (max-width: 599px) 100vw, (min-width: 600px) 600px, 237px">
<figcaption>
<span class="caption">Typing: A source of low-quality randomness.</span>
<span class="attribution"><a class="source" href="https://www.youtube.com/watch?v=wW_7qJAyUGU">ROLENSFX/YouTube</a>, <a class="license" href="http://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA</a></span>
</figcaption>
</figure>
<p>But it turns out some – even most – computer-generated “random” numbers <a href="http://www.pro-technix.com/information/crypto/pages/rfc1750_base.html">aren’t actually random</a>. They can follow subtle patterns that can be observed over long periods of time, or over many instances of generating random numbers. For example, a simple random number generator could be built by <a href="https://crypto.stackexchange.com/questions/18343/true-random-number-generator-by-milliseconds-per-keystroke-trng-kms">timing the intervals between a user’s keystrokes</a>. But the results would not really be random, because there are correlations and patterns in these timings, especially when looking at a large number of them.</p>
<p>Using this sort of output – numbers that appear at first glance to be unrelated but which really follow a hidden pattern – can weaken polls’ accuracy and communication secrecy, and render those simulations useless. How can we obtain high-quality randomness, and what does this even mean?</p>
<h2>Randomness quality</h2>
<p>To be most effective, we want numbers that are very close to random. Suppose a pollster wants to pick a random congressional district. As there are 435 districts, each district should have one chance in 435 of being picked. No district should be significantly more or less likely to be chosen.</p>
<p>Low-quality randomness is an even bigger concern for computer security. Hackers <a href="https://cointelegraph.com/news/lack-of-randomness-why-hackers-love-it">often exploit situations</a> where a supposedly random string isn’t all that random, like when an encryption key is generated with keystroke intervals.</p>
<figure class="align-right ">
<img alt="" src="https://images.theconversation.com/files/135977/original/image-20160830-26282-j6k43g.png?ixlib=rb-4.1.0&q=45&auto=format&w=237&fit=clip" srcset="https://images.theconversation.com/files/135977/original/image-20160830-26282-j6k43g.png?ixlib=rb-4.1.0&q=45&auto=format&w=600&h=408&fit=crop&dpr=1 600w, https://images.theconversation.com/files/135977/original/image-20160830-26282-j6k43g.png?ixlib=rb-4.1.0&q=30&auto=format&w=600&h=408&fit=crop&dpr=2 1200w, https://images.theconversation.com/files/135977/original/image-20160830-26282-j6k43g.png?ixlib=rb-4.1.0&q=15&auto=format&w=600&h=408&fit=crop&dpr=3 1800w, https://images.theconversation.com/files/135977/original/image-20160830-26282-j6k43g.png?ixlib=rb-4.1.0&q=45&auto=format&w=754&h=513&fit=crop&dpr=1 754w, https://images.theconversation.com/files/135977/original/image-20160830-26282-j6k43g.png?ixlib=rb-4.1.0&q=30&auto=format&w=754&h=513&fit=crop&dpr=2 1508w, https://images.theconversation.com/files/135977/original/image-20160830-26282-j6k43g.png?ixlib=rb-4.1.0&q=15&auto=format&w=754&h=513&fit=crop&dpr=3 2262w" sizes="(min-width: 1466px) 754px, (max-width: 599px) 100vw, (min-width: 600px) 600px, 237px">
<figcaption>
<span class="caption">Radioactive decay: Unpredictable, but not efficient for generating randomness.</span>
<span class="attribution"><a class="source" href="https://commons.wikimedia.org/wiki/File%3AAlpha_Decay.svg">Inductiveload</a></span>
</figcaption>
</figure>
<p>It turns out to be very hard for computers to generate truly random numbers, because computers are just machines that follow fixed instructions. One approach has been to use a physical phenomenon a computer can monitor, such as radioactive decay of a material or <a href="http://www.its.bldrdoc.gov/publications/85-173.aspx">atmospheric noise</a>. These are intrinsically unpredictable and therefore hard for a potential attacker to guess. However, these methods are <a href="https://www.random.org/randomness/">typically too slow to supply enough random numbers</a> for all the needs computers and people have.</p>
<p>There are other, more easily accessible sources of near-randomness, such as those keystroke intervals or <a href="http://dx.doi.org/10.1109/SYNASC.2008.36">monitoring computer processors’ activity</a>. However, these produce random numbers that do follow some patterns, and at best contain only some amount of uncertainty. These are low-quality random sources. They’re not very useful on their own. </p>
<p>What we need is called a randomness extractor: an algorithm that takes as input two (or more) independent, low-quality random sources and outputs a truly random string (or a string extremely close to random).</p>
<h2>Constructing a randomness extractor</h2>
<p>Mathematically, <a href="http://pages.cs.wisc.edu/%7Edieter/Courses/2013s-CS880/Scribes/PDF/lecture17.pdf">it is impossible to extract randomness</a> from just one low-quality source. A clever (but by now standard) argument from probability shows that <a href="https://homes.cs.washington.edu/%7Eanuprao/pubs/thesis.pdf">it’s possible to create a two-source extractor algorithm</a> to generate a random number. But that proof doesn’t tell us how to make one, nor guarantee that an efficient algorithm exists. </p>
<p>Until our recent work, the only known efficient two-source extractors required that at least one of the random sources actually had moderately high quality. We recently developed an <a href="http://eccc.hpi-web.de/report/2015/119/">efficient two-source extractor algorithm</a> that works even if both sources have very low quality.</p>
<p>Our algorithm for the two-source extractor has two parts. The first part uses a cryptographic method called a “<a href="http://dx.doi.org/10.1137/120868414">nonmalleable extractor</a>” to convert the two independent sources into one series of coin flips. This allows us to reduce the two-source extractor problem to solving a quite different problem.</p>
<p>Suppose a group of people want to collectively make an unbiased random choice, say among two possible choices. The catch is that some unknown subgroup of these people have their heart set on one result or the other, and want to influence the decision to go their way. How can we prevent this from happening, and ensure the ultimate result is as random as possible?</p>
<p>The simplest method is to just flip a coin, right? But then the person who does the flipping will just call out the result he wants. If we have everyone flip a coin, the dishonest players can cheat by waiting until the honest players announce their coin flips.</p>
<p>A middling solution is to let everyone flip a coin, and go with the outcome of a majority of coin flippers. This is effective if the number of cheaters is not too large; among the honest players, the number of heads is likely to differ from the number of tails by a significant amount. If the number of cheaters is smaller, then they won’t be able to affect the outcome.</p>
<h2>Protecting against cheaters</h2>
<p>We constructed an algorithm, called a “<a href="http://dx.doi.org/10.1109/SFCS.1985.55">resilient function</a>,” that tolerates a much larger number of cheaters. It depends on more than just the numbers of heads and tails. A building block of our function is called the “tribes function,” which we can explain as follows.</p>
<p>Suppose there are 44 people involved in collectively flipping a coin, some of whom may be cheaters. To make the collective coin flip close to fair, divide them into 11 subgroups of four people each. Each subgroup will call out “heads” if all of its members flip heads; otherwise it will say “tails.” The tribes function outputs “heads” if any subgroup says “heads;” otherwise it outputs “tails.”</p>
<p>The tribes function works well if there is just one cheater. This is because if some other member of the cheater’s subgroup flips tails, then the cheater’s coin flip doesn’t affect the outcome. However, it works poorly if there are four cheaters, and if those players all belong to the same subgroup. For then all of them could output “heads,” and force the tribes function to output “heads.”</p>
<p>To handle many cheaters, we build upon <a href="http://www.cs.huji.ac.il/%7Enati/PAPERS/ajtai_coalitions.pdf">work of Miklos Ajtai and Nati Linial</a> and use many different divisions into subgroups. This gives many different tribes functions. We then output “heads” if all these tribe functions output “heads”; otherwise we output “tails.” Even a large number of cheaters is unlikely to be able to control the output, ensuring the result is, in fact, very random.</p>
<p>Our extractor outputs just one almost random bit – “heads” or “tails.” Shortly afterwards Xin Li showed how to <a href="http://eccc.hpi-web.de/report/2015/125/">use our algorithm to output many bits</a>. While we gave an exponential improvement, <a href="http://eccc.hpi-web.de/report/2016/088/">other</a> <a href="http://eccc.hpi-web.de/report/2016/114/">researchers</a> <a href="http://eccc.hpi-web.de/report/2016/115/">have further improved our work</a>, and we are now very close to optimal. </p>
<p>Our finding is truly just one piece of a <a href="https://simons.berkeley.edu/programs/pseudorandomness2017">many-faceted puzzle</a>. It also advances an important field in the mathematical community, called Ramsey theory, which seeks to find <a href="http://www.cut-the-knot.org/Curriculum/Combinatorics/ThreeOrThree.shtml">structure even in random-looking</a> objects.</p><img src="https://counter.theconversation.com/content/59958/count.gif" alt="The Conversation" width="1" height="1" />
<p class="fine-print"><em><span>David Zuckerman receives or received funding from the National Science Foundation, the Simons Foundation, the U.S.-Israel Binational Science Foundation, Microsoft Research, the Institute for Advanced Study, the John S. Guggenheim Memorial Foundation, the Radcliffe Institute for Advanced Study, the David and Lucile Packard Foundation, the Alfred P. Sloan Foundation, and the Texas Higher Education Coordinating Board.</span></em></p><p class="fine-print"><em><span>Eshan Chattopadhyay receives or received funding from the National Science Foundation; University of Texas at Austin; Microsoft Research; the Institute for Advanced Study, Princeton; and the Simons Foundation. </span></em></p>A new way to generate random numbers can improve mathematics, cybersecurity and even predictions about the future. How does it work, and what does it mean for us?David Zuckerman, Professor of Computer Science, The University of Texas at AustinEshan Chattopadhyay, Postdoctoral Researcher in Mathematics, Institute for Advanced StudyLicensed as Creative Commons – attribution, no derivatives.