# Factorization Using Statistical Methods

We consider a number $N=AB$ where $A$ and $B$ are primes. Along the whole number-line from $1$ to $N$ we have two success points or target points: $A$ and $B$. If we had millions of target points the situation perhaps could have been better.

In the interval from $1$ to $N$, $A$ occurs $B$ times as a factor with different numbers:$1A,2A,\cdots,AB$

$B$ occurs as a factor with other numbers $A$ times:$1B,2B,3B,\cdots,AB$.

So we have a huge number of targets but we have to try out $gcd$ on the computer between $N$ and arbitrary large numbers less than $N$[using the division method]. Numbers larger than N might also be taken.

For a four hundred digit number we will have about $2*10^{200}$ target points for a bombing operation instead of two points $A$ and $B$, on the interval 1 to N.

There is a large increase in the density of targets in the range from 1 to N [to be precise on the interval from $\sqrt{N}$ to N].

For gaining efficiency, we may bend the number-line (from $1$ to $N$) round and round and then fire at the "targets" to improve the probability of success. Is it really going to help in any way if we work out the exercise on a computer using statistical methods?

A Simple Strategy:

Just imagine the number line from 1 to N=AB[and beyond] with the target points A ,2A,3A......AB,A(B+1),A(B+2).....[or B,2B,3B....AB,B(A+1),B(A+2)......] lying on it. Turn it round at the point AB and bring it down parallel to the first line. This will not give us any advantage[of increased target density] since the target points will lie against each other on the composite line. Suppose we do the turning at the point (AB)+1 and bring down the turned line parallel to the first one. The target points will not lie against each other on the composite line. The second line is turned again at the position corresponding to one on the first line or at some other suitable postion . This up and down turning action is repeated over and over again till two targets lie against each other on a pair of lines. Now on the composite line we have more than one,rather several targets on the interval $x$ to $x+\sqrt{N}$ if the composite line is viewed wrt the first line. In the selection process we should choose a point in the first line ,then another on the second and move forward across the lines and test for the gcd[by division method] for each selected point on the composite line with AB.

Some Introductory Calculations: [According to the Suggested Strategy]

We consider the number line from 1 to AB and beyond [from left to right] and extend it to AB+k . Then we bring it down parallel to the initial line to the point one[on the old line].We choose k such that 2k is integral. The extremities on the left are marked $P_1,P_2….$

$P_1=1,P_2=1+2(AB-1)+2k$.

For n similar turns we have:

$P(n)=1+n(2AB-2+2k)$

Let $n=A+j$, where j is a positive integer.[remembering that A is unknown]

$$P(j)=1+(A+j)(2AB-2+2k)$$ $$P(j) =(2AB-2+2k)j+A(2AB-2+2k)+1$$ The above equation is of the form :$y=mx+C$

Where,

$m=(2AB-2+2k)$

$C=A(2AB-2+2k)+1$

[y-mx=C and C-1 contains A as a factor]

Incidentally m and C are integers .”m” is known to us and C-1 contains A as a factor. Of course we don't know C.But we can increase m in steps of one through integral values[by increasing k in steps of 0.5 starting from 0.5] . C will increase in integral steps of A[=2kA] starting from some unknown value on the y-axis. For an integral value of x we can have an integral value of y only[since m and c are integral. On the graph we have an infinite number of inclined straight lines emanating from (0,C) The minimum value of gradient=2AB-1 ,[for k=.5].The gradient is allowed to increase/decrease in integral steps according to our choice.If the gradient increases/decreases by unity the intercept goes up/down by A. If we consider the vertical lines: x=n,where n is an integer., both x and y at the intersections should be integral.

Each line on the graph represents a particular type of bending[a particular value of 2k=integer]. If we move upwards for a fixed, integral value of $x$ the convenient integral points (x,y)on the different lines for which [y-mx-1=C-1 is a multiple of A] are separated by a distance $x+A$.[ k is increased in steps of 0.5]. This information could be used in a trial method where two or more values of x[ie j]are used.

For consecutive x[=j],the portion of a graph-line contains several target points.We may bend these lines over and over again to increase the density of points and consider their projections on the x-axis.

[We may ,alternatively, rotate the different graph lines[after bending them] to make them parallel wrt each other and then bring all the target points on the same straight line to increase the target density]

## migrated from stats.stackexchange.comDec 5 '11 at 23:13

This question came from our site for people interested in statistics, machine learning, data analysis, data mining, and data visualization.

• Bending on either side should be at some suitable integral point so that the target points on the new line do not align themselves against fractional points on the previous line. – Anamitra Palit Jan 2 '12 at 4:42
• It would always be convenient to have a bending strategy where the target points are arranged sequentially in the forward[or the backward ] direction as we move from one line to the next one in order[for some interval measuring $\sqrt{N}$].Bending should be allowed only at integral points.[You could also contemplate on devising alternative strategies based on statistical principles] – Anamitra Palit Jan 2 '12 at 6:16
• An alternative [to what I have said in my previous comment] would be to keep a theoretical "watch" or monitoring on how the target points are moving on the consecutive lines[component lines] over a particular interval on the composite line[viewed wrt the first line]. – Anamitra Palit Jan 2 '12 at 6:54

Unfortunately, the increase in density of targets isn't as great as you think; as you note there are $B$ multiples of $A$ less than $n$ and $A$ multiples of $B$ less than $n$. This gives you $A+B$ 'targets' to hit in an interval of size $n$. Picking $B\gt A$ for clarity, this means there are less than $2B$ total targets to hit, giving a probability of $\leq {2B\over n}$ for each shot to hit one, and meaning that it will take on average $\geq {n\over 2B} = \Theta(A)$ shots before you find a number $t$ with $\mathrm{GCD}(t,n)\gt 1$; this is no faster fundamentally than testing all the numbers up to $A$ (i.e., the smallest factor of $n$).
On the other hand, similar statistical ideas were used for some of the first real algorithmic speedups for factoring; in particular, the Pollard $\rho$ method takes avantage of an instance of the Birthday Paradox to factor $n=A\cdot B$ in time proportional to $\sqrt{A}$ rather than time proportional to $A$.