Trial division

Trial division

Trial division is the most laborious but easiest to understand of the integer factorization algorithms.

Given a composite integer "n" (throughout this article, "n" means "the integer to be factored"), trial division consists of trial-dividing "n" by every prime number less than or equal to scriptstylesqrt{n}. If a number is found which divides evenly into "n", that number is a factor of "n".

A definite bound on the prime factors is possible. Suppose "P"("i") is the "i"th prime, so that "P"(1) = 2, "P"(2) = 3, etc. Then the last prime number worth testing as a possible factor of "n" is "P"("i") where "P"("i" + 1)2 > "n"; equality here would mean that "P"("i" + 1) is a factor. This is all very well, but usually inconvenient to apply for the inspection of a single "n" since determining the correct value for "i" is more effort than simply trying the one unneeded candidate "P"("i" + 1) that would be involved in testing with all "P"("i") such that scriptstyle P(i) le sqrt{n}. Should the square root of "n" be integral, then it is a factor and "n" is a perfect square, not that this is a good way of finding them.

Trial division is guaranteed to find a factor of "n", since it checks all possible prime factors of "n". Thus, if the algorithm finds no factor, it is proof that "n" is prime.

In the worst case, trial division is a laborious algorithm. If it starts from 2 and works up to the square root of "n", the algorithm requires

:pi(sqrt{n}) approx {2sqrt{n} over ln n}

trial divisions, where scriptstyle pi(x) denotes the prime-counting function, the number of primes less than "x". This does not take into account the overhead of primality testing to obtain the prime numbers as candidate factors. If a variant is used without primality testing, but simply dividing by every odd number less than the square root of "n", prime or not, it can take up to about

:{sqrt{n}over 2}

trial divisions which for large "n" is worse.

This means that for "n" with large prime factors of similar size (like those used in public key cryptography), trial division is computationally infeasible.

However, for "n" with at least one small factor, trial division can be a quick way to find that small factor. It is worthwhile to note that for random "n", there is a 50% chance that 2 is a factor of "n", and a 33% chance that 3 is a factor, and so on. It can be shown that 88% of all positive integers have a factor under 100, and that 91% have a factor under 1000.

For most significant factoring concerns, however, other algorithms are more efficient and therefore feasible.

External links

* [http://www.btinternet.com/~se16/js/factor.htm Javascript Prime Factor Calculator using trial division] . Can handle numbers up to about 9×1015


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Trial of Conrad Murray — People v. Murray Court Superior Court of Los Angeles County Full case name People of the State of California v. Conrad Robert Murray Date decided November 7, 2011 Judge(s) sitting Michael E. Pastor Case opinions …   Wikipedia

  • Trial of Joseph Estrada — Soon after his ouster, the same charges were filed against him at the Sandiganbayan. After a lengthy trial, the Sandiganbayan ruled Estrada not guilty of perjury while ruling him as guilty of plunder and sentenced him to reclusión perpetua. All… …   Wikipedia

  • Trial of Kenneth Lay and Jeffrey Skilling — The trial of Kenneth Lay, former chairman and CEO of Enron, and Jeffrey Skilling, former CEO and COO, was presided over by federal district court Judge Sim Lake in 2006 in response to the Enron scandal. The only fact Skilling admitted was that… …   Wikipedia

  • Division (digital) — Several algorithms exist to perform division in digital designs. These algorithms fall into two main categories: slow division and fast division. Slow division algorithms produce one digit of the final quotient per iteration. Examples of slow… …   Wikipedia

  • Trial at bar — Bar Bar (b[aum]r), n. [OE. barre, F. barre, fr. LL. barra, W. bar the branch of a tree, bar, baren branch, Gael. & Ir. barra bar. [root]91.] 1. A piece of wood, metal, or other material, long in proportion to its breadth or thickness, used as a… …   The Collaborative International Dictionary of English

  • trial court — the court in which a controversy is first adjudicated (distinguished from appellate division). [1885 90] * * * …   Universalium

  • New York Supreme Court, Appellate Division — Map of the four departments of the New York Supreme Court, Appellate Division      First Department      Second Depar …   Wikipedia

  • Obedience trial — An obedience trial is a dog sport in which a dog must perfectly execute a predefined set of tasks when directed to do so by his handler. According the American Kennel Club (AKC) obedience regulations The basic objective of obedience trials,… …   Wikipedia

  • 12th SS Panzer Division Hitlerjugend — Infobox Military Unit unit name=12th SS Panzer Division Hitlerjugend caption=Unit insignia of 12.SS Panzer Division Hitlerjugend . The symbol was the result of a competition. dates=1943 1945 country=Nazi Germany branch=Waffen SS type=Armoured… …   Wikipedia

  • Mock trial — A Mock Trial is an act or imitation trial. It is similar to a moot court, but mock trials simulate lower court trials, while moot court simulates appellate court hearings. Attorneys preparing for a real trial might use a mock trial consisting of… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”