How well can a human-generated "random number" be predicted? For example, if i ask an individual to write a 20-number-long sequence of random numbers from 0 to 10. How well can I predict the 20th number from the initial 19?

More generally, 


How well can subsequent numbers in a sequence be predicted from previous numbers?
How well can humans generate random sequences of numbers?
It seems like there is a fairly big literature on this topic.

Wagenaar (1972) provides an early review of research. The author summarises around 15 studies. The studies involved generated random elements including letters and numbers of varying lengths. In all but one study, participants were deemed to be not good at randomising. As part of their review they talk about various forms of nonrandomness and factors that increased the nonrandomness (e.g., naivity of subjects regarding types of randomness, boredom, presence of a natural order to the objects, etc.). In general participants either engaged in too much alternation or too many runs of the same response. Wagenaar (1972) noted the need for more research. The general model seemed to be one whereby stable individual differences (e.g., memory, skill, and mental representations of randomness), states (e.g., boredom, fatigue), and inherent constraints on human randomness generation interacted to influence the degree of randomness produced.

Towse and Neil (1998) provide software call RgCalc for evaluating randomness in human generated sequences.

Brugger (1997) provides a more recent review, summarising:


  It is conjectured that Tune's explanation of sequential nonrandomness
  in terms of a limited capacity of short-term memory can no longer be
  maintained. Rather, interdependence among consecutive choices is
  considered a consequence of an organism's natural susceptibility to
  interference. Random generation is thus a complex action which demands
  complete suppression of any rule-governed behavior.


I also found a couple of articles by Persaud (2005) and Figurska et al (2008) that might be relevant.

Summary: Humans typically display some form of nonrandomness when generating sequences of digits. The degree of this nonrandomness varies across people. It is unclear to me at this point how well individuals could perform, for example, if they had an aptitude for random number generation or were trained to generate random numbers. For example, individuals might be able to draw on cues in the external world that are random and use that as their own personal input for generating responses (but perhaps this would be considered cheating).

However, the nonrandomness may only enable very small incremental prediction above chance in predicting any given response. Furthermore, presumably longer initial sequences of response would improve the ability to guess the subsequent response. Having longer sequences would allow you to extract the form of nonrandomness that the particular individual adopts (e.g., do they prefer alternating numbers or runs, do they prefer some digits over others, are there sequences of numbers preferred).

References


Brugger, P. (1997). Variables that influence the generation of random sequences: An update. Perceptual and Motor Skills, 84(2), 627-661.
Figurska, M., Stańczyk, M., &amp; Kulesza, K. (2008). Humans cannot consciously generate random numbers sequences: Polemic study. Medical hypotheses, 70(1), 182-185.
Persaud, N. (2005). Humans can consciously generate random number sequences: A possible test for artificial intelligence. Medical hypotheses, 65(2), 211-214.
Towse, J. N., &amp; Neil, D. (1998). Analyzing human random generation behavior: A review of methods used and a computer program for describing performance. Behavior Research Methods, Instruments, &amp; Computers, 30(4), 583-591.
Wagenaar, W. A. (1972). Generation of random sequences by human subjects: A critical survey of literature. Psychological Bulletin, 77(1), 65-72.