r16 r17 r1 r2 r3 Not to be confused with Monte Carlo method.

In computing, a Monte Carlo algorithm is a randomized algorithm whose running time is deterministic, but whose output may be incorrect with a certain (typically small) probability.

The related class of Las Vegas algorithms are also randomized, but in a different way: they take an amount of time that varies randomly, but always produce the correct answer. A Monte Carlo algorithm can be converted into a Las Vegas algorithm whenever there exists a procedure to verify that the output produced by the algorithm is indeed correct. If so, then the resulting Las Vegas algorithm is merely to repeatedly run the Monte Carlo algorithm until one of the runs produces an output that can be verified to be correct.

The name refers to the grand casino in the Principality of Monaco at Monte Carlo, which is well-known around the world as an icon of gambling.

Contents 1 One-sided vs two-sided error 2 Amplification 3 Complexity classes 4 Applications in computational number theory 5 See also 6 References

One-sided vs two-sided error

Whereas the answer returned by a deterministic algorithm is always expected to be correct, this is not the case for Monte Carlo algorithms. For decision problems, these algorithms are generally classified as either false-biased or true-biased. A false-biased Monte Carlo algorithm is always correct when it returns false; a true-biased algorithm is always correct when it returns true. While this describes algorithms with one-sided errors, others might have no bias; these are said to have two-sided errors. The answer they provide (either true or false) will be incorrect, or correct, with some bounded probability.

For instance, the Solovay–Strassen primality test is used to determine whether a given number is a prime number. It always answers true for prime number inputs; for composite inputs, it answers false with probability at least ½ and true with probability at most ½. Thus, false answers from the algorithm are certain to be correct, whereas the true answers remain uncertain; this is said to be a ½-correct false-biased algorithm. Amplification

For a Monte Carlo algorithm with one-sided errors, the failure probability can be reduced (and the success probability amplified) by running the algorithm k times. Consider again the Solovay–Strassen algorithm which is ½-correct false-biased. One may run this algorithm multiple times returning a false answer if it reaches a false response within k iterations, and otherwise returning true. Thus, if the number is prime then the answer is always correct, and if the number is composite then the answer is correct with probability at least 1−(1−½)k = 1−2−k.

For Monte Carlo decision algorithms with two-sided error, the failure probability may again be reduced by running the algorithm k times and returning the majority function of the answers. Complexity classes

The complexity class BPP describes decision problems that can be solved by polynomial-time Monte Carlo algorithms with a bounded probability of two-sided errors, and the complexity class RP describes problems that can be solved by a Monte Carlo algorithm with a bounded probability of one-sided error: if the correct answer is no, the algorithm always says so, but it may answer no incorrectly for some instances where the correct answer is yes. In contrast, the complexity class ZPP describes problems solvable by polynomial expected time Las Vegas algorithms. ZPP ⊆ RP ⊆ BPP, but it is not known whether any of these complexity classes is distinct from each other; that is, Monte Carlo algorithms may have more computational power than Las Vegas algorithms, but this has not been proven. Another complexity class, PP, describes decision problems with a polynomial-time Monte Carlo algorithm that is more accurate than flipping a coin but where the error probability cannot be bounded away from ½. Applications in computational number theory

Well-known Monte Carlo algorithms include the Solovay–Strassen primality test, the Baillie-PSW primality test, the Miller–Rabin primality test, and certain fast variants of the Schreier–Sims algorithm in computational group theory. See also Monte Carlo methods, algorithms used in physical simulation and computational statistics based on taking random samples Atlantic City algorithm Las Vegas algorithm

Fantasy bond and Monte Carlo algorithm

The Fantasy bond is a type of relationship where the basic tie is based on routines and roles, rather than spontaneous feelings. It is a term used to describe an imaginary connection formed originally by the infant with the parent or primary caregiver, but also describes an illusory connection to another person that adults attempt to establish in their intimate associations, which leads to deterioration in the relationship.

This type of bond is differentiated from the positive bonding that occurs in secure attachments. The fantasy bond offers an illusion of love which prevents real emotional contact, and can be linked to the pseudo-independence of the self-parenting character.

Contents 1 Origins 1.1 Later life 1.2 Therapy 2 See also 3 References 4 Further reading 5 External links


The origins of a fantasy bond can be found in the failures of childhood parenting, denial of which leads to an over-valuation and idealisation of the parent/parents in question.

The result can be a sense of grandiosity based on the internalisation of the parental value systems, an acceptance of the inner critic with its automatic thoughts as a substitute for real relating.

Such over-idealisation of the past protects against the re-emergence of painful memories, but also ties into the perpetuation of current ersatz relationships with only the object of idolatry changed in the new fantasy bond. The fantasy bond acts as a painkiller that cuts off feeling responses and interferes with the development of a true sense of self, and the more a person comes to rely on fantasies of connection, the less he or she will seek or be able to accept love and affection in a real relationship.

The fantasy bond is the primary defense against separation anxiety, interpersonal pain, and existential dread. Infants naturally comfort themselves by using images and self-soothing behaviors to ease the anxiety of being separated from their caregivers, so when caregivers are often unavailable or inconsistent in meeting an infant's needs, the infant increasingly turns to an image of being connected to them. This fantasy bond is a substitute for the love and care that may be missing. Later life

In later life the fantasy bond may provide an illusory sense of safety against the threat of the approach of death. To varying degrees, all people tend to make imagined connections with people in their lives. Many people have a fear of intimacy and at the same time are terrified of being alone. A fantasy bond allows them to maintain a certain emotional distance while relieving loneliness, but this bond reduces the possibility of achieving success in a relationship. Therapy

Therapists are warned to guard against the emergence of a false transference based on a fantasy bond and fuelled especially by narcissism. See also Alice Miller

Attachment theory


Good enough parent

Heinz Kohut

Narcissistic parents

Narcissistic supply

Parentification True self and false self