[Algorithm] monkey theory

October 1, our school information group training course in Hangzhou, not only from the chiefs% across the country, but also learned a monkey theory. I feel deeply admire this advanced theory and decided this would be my understanding of the theory of monkeys write this.

Monkey theory is based on the uncertainty principle and Schrodinger and the Heisenberg uncertainty principle put forward, showing a solid foundation for its theory. Monkey theory developed in the OI algorithm, the same people who can penetrate all areas of industries, it shows the breadth and authenticity.

There is a world-famous experiment - Schrödinger's cat. This experiment refers to a cat kept in a sealed container containing a small amount of radium and cyanide inside. There is the probability of the decay of radium, if the decay of radium occur, will trigger organ with a broken bottle of cyanide, the cat will die; if the decay of radium does not occur, the cat will survive. According to quantum mechanics, due to radioactive decay of radium in a superposition of two states and does not decay, the cat should live cat and a dead cat in a superposition state. This only is dead and living cat is called "Schrödinger cat." (Baidu Encyclopedia)

First proposed monkey theory is inseparable from the monkey sort, we all know, the monkey sorting algorithm sorting algorithm is the most probabilistic. According to quantum mechanics, the successful sequencing and time-out success at the specified time for sorting monkey sorting algorithm are possible, with no overtime overtime is a pair of superposition state, if the timeout is TLE, no timeout is AC, AC and so also in OIer TLE two kinds of superposition state, that is, to write the algorithm OIer both AC and TLE, but in fact, we have only one state, according to Murphy's law - there is something probability of occurrence will happen, so long as we submission codes, always AC. Monkey in this sort of clever, it does not guarantee you AC, but it can guarantee that you will always AC.

For the Heisenberg uncertainty principle, this theory is that you can not simultaneously know the position of a particle and its speed, uncertainty in particle position, must be greater than or equal to Planck's constant (Planck constant) divided by 4π (ΔxΔp≥h / 4π), which indicates that the microscopic world of particle behavior and macroscopic matter is very different. In addition, the uncertainty principle involves a lot of deep philosophical question, with Heisenberg's own words: "In the statement of causality, that 'if know exactly now, we can foresee the future', the results are not conclusions, but premise. we can not know all the details now, is a principled thing. "(Baidu Encyclopedia)

In summary, Heisenberg's theory which we can not predict the future, we can not fully know all the details now. So we will have a corollary: even submit code uses a random number, we can not entirely sure he would WA.

According infinite monkey theorem, the observable universe is full of monkey has been kept typing, you can play Hamlet is still a probability less . (Visible low probabilities). But if we narrow the scope of random answers, we can reduce the probability of WA.

The monkey theorem, we can see that hill-climbing algorithm, simulated annealing algorithm and the like is a certain correctness. Assuming that the world we live wire will eventually lead us WA, but will be able to reduce the probability wa simulated annealing, so we will eventually move towards a world AC line.

Guess you like

Origin www.cnblogs.com/markia/p/11699637.html