4 ms·
Can they? Genuine question.
by radarsat1 11y ago
Can they? Genuine question.
- fahadkhan 11y agoYes, it's normally one of the first programs most people tackle when learning a new programming language.
- radarsat1 11y agoWhat is? My question was about whether random numbers can have patterns. I thought a sort of general definition of patterns was the existence of correlation from one state to another, while the definition of randomness was the lack of the same correlation. So I'm wondering how random numbers can have patterns? It's possible my view of "random numbers" and "patterns" is not sufficiently nuanced. I have no idea what your comment means in this context.
- fahadkhan 11y agoSorry I thought the context of your question was "Prime numbers may be generated in deterministic fashion" Of course you know that random numbers will have a distribution. I think this is an example of that. Most people would have expected a uniform distribution here but it isn't the case.
- sp332 11y agoYeah, it depends on the distribution you're sampling from. It's possible (often desirable) to introduce a bias when picking a random number. http://www.boost.org/doc/libs/1_42_0/libs/random/index.html http://www.boost.org/doc/libs/1_42_0/libs/random/index.html
- radarsat1 11y agoRight, but then they aren't random, right? I feel like this is a problem of semantics.. what do we mean by "random number"? I thought the definition was basically, "lack of pattern." What is a better definition?
- sp332 11y agoWell it's degrees of random. You just shift the probabilities. Rolling a die is still random even though you'll never roll a 7, or a 3.5, or a "b". Picking a number from a normal distribution is still random even though it's more likely to get you a sample from the center than from the edges.
- parenthephobia 11y agoIn mathematical terms, random refers to a quantity which is "randomly" picked from a distribution. In a sense, things are only random in reference to a distribution. A "random number" in the lay sense is a "random number from a uniform probability distribution"; a uniform distribution being one where each element is equally likely. You might note there are still patterns in uniform distributions. e.g. Uniformly random integers are never not integers, and they also fit within a particular range: we have no way to pick random numbers uniformly between -infinity and infinity.
- mturmon 11y agoIt's actually a very good question. Even up to the Renaissance, we had no real conception of "probability" -- even though there were games of chance that depended on it. The Greeks had notions of impossible/possible/likely, but no way to link the notions to the world. It was finally in the correspondence of Pascal and Fermat in 1654 that a mathematics for probability started to emerge. With the emergence of the laws of large numbers, this mathematics could be linked to observable real-world occurrence rates. (Ian Hacking's book "The Emergence of Probability" is a standard reference, http://www.jstor.org/stable/2184357?seq=1#page_scan_tab_contents. http://www.jstor.org/stable/2184357?seq=1#page_scan_tab_cont...) Suppose you were confronted with a stream of random numbers, and no intellectual or mathematical framework for quantifying them. Just coming up with a notion of a frequency curve (i.e., a density), and statistical independence of "unlinked" events would be a huge leap. I used to TA an undergrad probability class, and in the first weeks, I'd ask the students to quantify some random variable, and they'd sometimes blankly look back and say, "it's just random" -- what we taught them is how you break that down in terms of the familiar quantities (densities, independence, correlations) and operations (multiplying for independence, integrating for expectation, integrating and renormalizing for conditioning). So to get back to your original question, even a deterministic sequence, like 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, ... could be regarded as random, and given a density and all the other folderol. And a "completely random" sequence of 0/1 equiprobable bits also has a density, etc. And so does everything in between.
- radarsat1 11y agoThank you, that is a very good answer. So "random" is how you look at a sequence. It's more a model (context in which to interpret a sequence) than an observable fact. Is that a fair interpretation? By saying "this is a random sequence," you enable a statistical view of the problem. Even for purely deterministic sequences, this can be useful. Last question, something I've never been perfectly clear on, what is the difference between "random" and "stochastic"? My understanding is that a stochastic model is a model featuring stochastic variables, which are variables that draw from some random distribution. Is the terminology I am using correct?
- 11y ago
- jrochkind1 11y agoThe idea of what "random" means turns out to not be very simple after all. I think in a typical definition (at least as used for CS?), a "random" sequence of numbers _by definition_ has no predictable pattern to it -- that's what makes it random. Of course, a given sequence of random numbers could _happen_ to have all sorts of patterns in it (and indeed, you could find patterns to post-fit to any sequence), but if you can predict it in advance... it's not "random"? I think?
- noamyoungerm 11y agoWell, we're all familiar with https://xkcd.com/221/ https://xkcd.com/221/ or http://dilbert.com/strip/2001-10-25 http://dilbert.com/strip/2001-10-25 The possibility, however remote, exists that you will randomly select a sequence with patterns and order. In cryptography, we define the term 'pseudorandom' in order to discuss a class of functions that look random. Pseudorandom sequences are sequences where, given the first n bytes of the sequence, an adversary cannot guess the n+1th byte with probability significantly higher than 1/2. Basically, it's important to distinguish between blindly selecting a sequence out of all possible sequences, and finding a particular sequence with no discernible internal order.
- tripzilch 11y agoI used to have a version of that Dilbert comic as a forum signature for a while, except I hacked a little PHP script so it would insert a random number instead of "nine" into that panel (still repeated), different on every reload. Just to confuse people :)
- deleted 11y ago[deleted]