Bogosort
   HOME
*



picture info

Bogosort
In computer science, bogosort (also known as permutation sort, stupid sort, slowsort or bozosort) is a sorting algorithm based on the generate and test paradigm. The function successively generates permutations of its input until it finds one that is sorted. It is not considered useful for sorting, but may be used for educational purposes, to contrast it with more efficient algorithms. Two versions of this algorithm exist: a deterministic version that enumerates all permutations until it hits a sorted one,. and a randomized version that randomly permutes its input. An analogy for the working of the latter version is to sort a deck of cards by throwing the deck into the air, picking the cards up at random, and repeating the process until the deck is sorted. Its name is a portmanteau of the words ''bogus'' and ''sort''. Description of the algorithm The following is a description of the randomized algorithm in pseudocode: while not sorted(deck): shuffle(deck) Here is the ab ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  




BogoSort
In computer science, bogosort (also known as permutation sort, stupid sort, slowsort or bozosort) is a sorting algorithm based on the generate and test paradigm. The function successively generates permutations of its input until it finds one that is sorted. It is not considered useful for sorting, but may be used for educational purposes, to contrast it with more efficient algorithms. Two versions of this algorithm exist: a deterministic version that enumerates all permutations until it hits a sorted one,. and a randomized version that randomly permutes its input. An analogy for the working of the latter version is to sort a deck of cards by throwing the deck into the air, picking the cards up at random, and repeating the process until the deck is sorted. Its name is a portmanteau of the words ''bogus'' and ''sort''. Description of the algorithm The following is a description of the randomized algorithm in pseudocode: while not sorted(deck): shuffle(deck) Here is the ab ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Sorting Algorithm
In computer science, a sorting algorithm is an algorithm that puts elements of a List (computing), list into an Total order, order. The most frequently used orders are numerical order and lexicographical order, and either ascending or descending. Efficient sorting is important for optimizing the Algorithmic efficiency, efficiency of other algorithms (such as search algorithm, search and merge algorithm, merge algorithms) that require input data to be in sorted lists. Sorting is also often useful for Canonicalization, canonicalizing data and for producing human-readable output. Formally, the output of any sorting algorithm must satisfy two conditions: # The output is in monotonic order (each element is no smaller/larger than the previous element, according to the required order). # The output is a permutation (a reordering, yet retaining all of the original elements) of the input. For optimum efficiency, the input data should be stored in a data structure which allows random access ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Generate And Test
Trial and error is a fundamental method of problem-solving characterized by repeated, varied attempts which are continued until success, or until the practicer stops trying. According to W.H. Thorpe, the term was devised by C. Lloyd Morgan (1852–1936) after trying out similar phrases "trial and failure" and "trial and practice". Under Morgan's Canon, animal behaviour should be explained in the simplest possible way. Where behavior seems to imply higher mental processes, it might be explained by trial-and-error learning. An example is a skillful way in which his terrier Tony opened the garden gate, easily misunderstood as an insightful act by someone seeing the final behavior. Lloyd Morgan, however, had watched and recorded the series of approximations by which the dog had gradually learned the response, and could demonstrate that no insight was required to explain it. Edward Lee Thorndike was the initiator of the theory of trial and error learning based on the findings he sh ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Slowsort
Slowsort is a sorting algorithm. It is of humorous nature and not useful. It is a ''reluctant algorithm'' based on the principle of ''multiply and surrender'' (a parody formed by taking the opposites of '' divide and conquer''). It was published in 1986 by Andrei Broder and Jorge Stolfi in their paper ''Pessimal Algorithms and Simplexity Analysis'' (a parody of '' optimal algorithms'' and ''complexity analysis''). Algorithm Slowsort is a recursive algorithm. * It sorts in-place. * It is a stable sort. (It does not change the order of equal-valued keys.) This is an implementation in pseudocode: procedure slowsort(A[], start_idx, end_idx) // Sort array range A[start ... end] in-place. if start_idx ≥ end_idx then return middle_idx := floor( (start_idx + end_idx)/2 ) slowsort(A, start_idx, middle_idx) // (1.1) slowsort(A, middle_idx + 1, end_idx) // (1.2) if A nd_idx -> slowsort xs , length xs 0. Slowsort is therefore ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Randomized Algorithm
A randomized algorithm is an algorithm that employs a degree of randomness as part of its logic or procedure. The algorithm typically uses uniformly random bits as an auxiliary input to guide its behavior, in the hope of achieving good performance in the "average case" over all possible choices of random determined by the random bits; thus either the running time, or the output (or both) are random variables. One has to distinguish between algorithms that use the random input so that they always terminate with the correct answer, but where the expected running time is finite (Las Vegas algorithms, for example Quicksort), and algorithms which have a chance of producing an incorrect result (Monte Carlo algorithms, for example the Monte Carlo algorithm for the MFAS problem) or fail to produce a result either by signaling a failure or failing to terminate. In some cases, probabilistic algorithms are the only practical means of solving a problem. In common practice, randomized algor ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Sorting
Sorting refers to ordering data in an increasing or decreasing manner according to some linear relationship among the data items. # ordering: arranging items in a sequence ordered by some criterion; # categorizing: grouping items with similar properties. Ordering items is the combination of categorizing them based on equivalent order, and ordering the categories themselves. Sorting information or data In , arranging in an ordered sequence is called "sorting". Sorting is a common operation in many applications, and efficient algorithms to perform it have been developed. The most common uses of sorted sequences are: * making lookup or search efficient; * making merging of sequences efficient. * enable processing of data in a defined order. The opposite of sorting, rearranging a sequence of items in a random or meaningless order, is called shuffling. For sorting, either a weak order, "should not come after", can be specified, or a strict weak order, "should come before" (specif ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Miracle
A miracle is an event that is inexplicable by natural or scientific lawsOne dictionary define"Miracle"as: "A surprising and welcome event that is not explicable by natural or scientific laws and is therefore considered to be the work of a divine agency." and accordingly gets attributed to some supernatural or praeternatural cause. Various religions often attribute a phenomenon characterized as miraculous to the actions of a supernatural being, (especially) a deity, a magician, a miracle worker, a saint, or a religious leader. Informally, English-speakers often use the word ''miracle'' to characterise any beneficial event that is statistically unlikely but not contrary to the laws of nature, such as surviving a natural disaster, or simply a "wonderful" occurrence, regardless of likelihood (e.g. "the miracle of childbirth"). Some coincidences may be seen as miracles. A true miracle would, by definition, be a non-natural phenomenon, leading many writers to dismiss miracles as p ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Ackermann's Function
In computability theory, the Ackermann function, named after Wilhelm Ackermann, is one of the simplest and earliest-discovered examples of a total computable function that is not primitive recursive. All primitive recursive functions are total and computable, but the Ackermann function illustrates that not all total computable functions are primitive recursive. After Ackermann's publication of his function (which had three non-negative integer arguments), many authors modified it to suit various purposes, so that today "the Ackermann function" may refer to any of numerous variants of the original function. One common version, the two-argument Ackermann–Péter function is defined as follows for nonnegative integers ''m'' and ''n'': : \begin \operatorname(0, n) & = & n + 1 \\ \operatorname(m+1, 0) & = & \operatorname(m, 1) \\ \operatorname(m+1, n+1) & = & \operatorname(m, \operatorname(m+1, n)) \end Its value grows rapidly, even for small inputs. For example, is an integer of ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  




In-joke
An in-joke, also known as an inside joke or a private joke, is a joke whose humour is understandable only to members of an ingroup; that is, people who are ''in'' a particular social group, occupation, or other community of shared interest. It is, therefore, an esoteric joke, only humorous to those who are aware of the circumstances behind it. In-jokes may exist within a small social clique, such as a group of friends, or extend to an entire profession or other relatively large group. An example is: ::Q: What's yellow and equivalent to the axiom of choice? ::A: Zorn's lemon. Individuals not familiar with the mathematical result Zorn's lemma are unlikely to understand the joke. The joke is a pun on the name of this result. Ethnic or religious groups may also have in-jokes. Philosophy In-jokes are cryptic allusions to shared common ground that act as selective triggers; only those who share that common ground are able to respond appropriately. An in-joke can work to build comm ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Many-worlds Interpretation
The many-worlds interpretation (MWI) is an interpretation of quantum mechanics that asserts that the universal wavefunction is objectively real, and that there is no wave function collapse. This implies that all possible outcomes of quantum measurements are physically realized in some "world" or universe. In contrast to some other interpretations, such as the Copenhagen interpretation, the evolution of reality as a whole in MWI is rigidly deterministic and local. Many-worlds is also called the relative state formulation or the Everett interpretation, after physicist Hugh Everett, who first proposed it in 1957.Hugh Everettbr>Theory of the Universal Wavefunction Thesis, Princeton University, (1956, 1973), pp 1–140 Bryce DeWitt popularized the formulation and named it ''many-worlds'' in the 1970s. See also Cecile M. DeWitt, John A. Wheeler eds, The Everett–Wheeler Interpretation of Quantum Mechanics, ''Battelle Rencontres: 1967 Lectures in Mathematics and Physics'' (1968)Bryce ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


While(true)
In computer programming, an infinite loop (or endless loop) is a sequence of instructions that, as written, will continue endlessly, unless an external intervention occurs ("pull the plug"). It may be intentional. Overview This differs from: * "a type of computer program that runs the same instructions continuously until it is either stopped or interrupted." Consider the following pseudocode: how_many = 0 while is_there_more_data() do how_many = how_many + 1 end display "the number of items counted = " how_many ''The same instructions'' were run ''continuously until it was stopped or interrupted'' . . . by the ''FALSE'' returned at some point by the function ''is_there_more_data''. By contrast, the following loop will not end by itself: birds = 1 fish = 2 while birds + fish > 1 do birds = 3 - birds fish = 3 - fish end ''birds'' will alternate being 1 or 2, while ''fish'' will alternate being 2 or 1. The loop will not stop unless an external intervention occur ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Single-event Upset
A single-event upset (SEU), also known as a single-event error (SEE), is a change of state caused by one single ionizing particle (ions, electrons, photons...) striking a sensitive node in a live micro-electronic device, such as in a microprocessor, semiconductor memory, or power transistors. The state change is a result of the free charge created by ionization in or close to an important node of a logic element (e.g. memory "bit"). The error in device output or operation caused as a result of the strike is called an SEU or a soft error. The SEU itself is not considered permanently damaging to the transistor's or circuits' functionality unlike the case of single-event latch-up (SEL), single-event gate rupture (SEGR), or single-event burnout (SEB). These are all examples of a general class of radiation effects in electronic devices called ''single-event effects'' (SEEs). History Single-event upsets were first described during above-ground nuclear testing, from 1954 to 1957, wh ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]