Total Pageviews

Thursday, August 28, 2014

If you do not understand the theoretical demonstration of P=NP, here is the empirical proof

If you do not understand the theoretical demonstration of P=NP,
here is the empirical proof

No need complications

1) Download & Run 
2) Review & Calculate the Complexity by Yourself 
3) P = N

if you still do not understand the proof of Schinzel's hypothesis H

If you still do not understand the proof of Schinzel's hypothesis H, base = N here, the rest is self-explanatory. 

The proof of Schinzel's hypothesis H


Prime Factorization P=NP

http://github.com/maxtuno/Universal

"""
One of these elementary operations +, *, -, /
can replace tons and tons of computational process,
that is P = NP. - O. A. Riveros
"""
__author__ = "O. A. Riveros"
__copyright__ = "Copyright 2014, O. A. Riveros, All right reserved"
__license__ = "MIT"
__email__ = "oscar.riveros@gmail.com"
"""
O. A. Riveros
http://independent.academia.edu/oarr
http://twitter.com/maxtuno
"""

PX.<z> = PolynomialRing(ZZ)

def riverian_coefficients_of(n,base):
    return n.digits(base=base)
  
def riverian_polynomial_of(n,base=10):
    P = riverian_coefficients_of(ZZ(n),base)
    return PX(P)
      
def riverian_bases_of(n):
    T = []
    base = 2      
    while 2 <= base <= isqrt(n):
        O = riverian_polynomial_of(n,base)      
        if not(O.is_irreducible()):
            T = T + [base]
        base += 1      
    return T
  
def riverian_small_base_of(n):
    base = 2
    while 2 <= base <= isqrt(n):
        O = riverian_polynomial_of(n,base)      
        if not(O.is_irreducible()):
            return base
        base += 1
    return -1

p = random_prime(10^5)
q = random_prime(10^5)
print(q, p, p*q)

g = riverian_polynomial_of(p*q, 2)

print(g.is_irreducible(), g)

base = riverian_small_base_of(p*q)

print(base)

f = riverian_polynomial_of(p*q, base)

print(f.is_irreducible(), f)

factors = list(factor(f))

print(factors)#

a, b = factors

print(a[0](z=base), b[0](z=base))
print(p, q)

print(g(2) == f(base))

print(g)
print(f)

"""
(76801, 14479, 1112001679)
(True, z^30 + z^25 + z^22 + z^18 + z^17 + z^16 + z^15 + z^14 + z^11 + z^10 + z^7 + z^3 + z^2 + z + 1)
1113
(False, 897*z^2 + 742*z + 40)
[(13*z + 10, 1), (69*z + 4, 1)]
(14479, 76801)
(14479, 76801)
True
z^30 + z^25 + z^22 + z^18 + z^17 + z^16 + z^15 + z^14 + z^11 + z^10 + z^7 + z^3 + z^2 + z + 1
897*z^2 + 742*z + 40
"""

"""
These algorithms are the first algorithms that develops after using the binary representation to prove P = NP, every number is polynomial in its base, and the primes are irreducible polynomials in all bases, that is a Universal property, unlike of others that depend on the numerical representation.

Attached two algorithms that let you search the "bases" where a number is reducible, both are brute force, there is a pattern in these bases, we can deduce, with the understanding of the properties of reducible polynomials, and this is a good book about: http://www.cambridge.org/gb/academic/subjects/mathematics/number-theory/polynomials-special-regard-reducibility

No results below the already processed, since the entire security of the world depends on the impossibility of factoring large prime numbers, and would be very irresponsible to do, and given that the knowledge necessary for this pattern are very advanced, the encryption now has to do with intelligence and not a fantasy as it is so far.

It is clear that with this technique, we free ourselves from the shackles of binary representation, being able to express and solve any NP-complete problem as a polynomial equation.

I am aware of what it means to reveal to the world that P = NP, are the consequences and implications, but I told everyone including the NSA that P = NP, all authorities and "scholars" by only gave me back, have laughed and continued their day, which is why I wash my hands about the responsibility more falls on them and in particular managers.
"""

"""
Estos algoritmos son los primeros algoritmos que desarrolle, despues de usar la representacion binaria para demostrar P=NP, todo numero es polinomio de su base, y los numeros primos, son polinomios irreducibles en todas las bases, esa es una propiedad Universal, a diferencia de otras que dependen de la representacion numerica.

Adjunto dos algoritmos que permiten buscar las "bases" donde un numero es reducible, ambos son de fuerza bruta, existe un patron en estas bases, que se puede deducir, con el entendimiento de las propiedades de los polinomios reducibles, y este es un buen libro al respecto: http://www.cambridge.org/gb/academic/subjects/mathematics/number-theory/polynomials-special-regard-reducibility

No adjunto los resultados ya procesados, ya que toda la seguridad del mundo depende de la imposibilidad de factorizar numeros primos muy grandes, y seria muy irresponsable hacerlo, y dado que los conocimientos necesarios para obtener dicho patron son muy avanzados, la encriptacion ahora, tiene que ver con la inteligencia y no con una fantasia como lo es hasta ahora.

Esta claro que con esta tecnica, nos liberamos de las ataduras de la representacion binaria, pudiendo expresar y resolver cualquier problema NP-Completo como una ecuacion polinomial.

Yo estoy conciente de lo que significa revelar al mundo que P=NP, se las consecuencias y se las implicancias, pero yo le he dicho a todo el mundo incluyendo la NSA que P=NP, todas las autoridades y los "eruditos" a cargo, solo me han dado la espalda, se han reido y continuado su dia, es por esto que me lavo las manos al respecto la responsablidad recae sobre ellos y en particular sobre los encargados.
"""

Monday, August 25, 2014

Constant (< Linear) algorithm for solving the intractable exponential problem Tower of Hanoi.

Python there is overflow (bug), strongly recommend http://sagemath.org 
used to test the P=NP algorithms @sagemath
(http://twitter.com/maxtuno/status/504016698945851392) 
 
The source code https://github.com/maxtuno/Universal 
 
"""
One of these elementary operations +, *, -, / can replace tons and tons of computational process, that is P = NP. - O. A. Riveros
"""

__author__ = "O. A. Riveros"
__copyright__ = "Copyright 2014, O. A. Riveros, All right reserved"
__license__ = "MIT"
__email__ = "oscar.riveros@gmail.com"

"""
O. A. Riveros
http://independent.academia.edu/oarr
http://twitter.com/maxtuno
"""

# The H(n) function of the Proof P = NP
def H(n):
    return (2^n)^(2^n) + (2^n - (2^n)^(2^n))/(2^n - 1)^2

def slice(l, n):
    return list(l[i:i + n] for i in range(0, len(l), n))

def binary_solution_for_tower_of_hanoiof_n_disk(n):
    return(slice(Integer(H(n)).digits(base=2), n))

print(binary_solution_for_tower_of_hanoiof_n_disk(3))
print(binary_solution_for_tower_of_hanoiof_n_disk(5))
       
"""
This is for sage math (http://www.sagemath.org) in pure python have overflow, erromeos results.
"""
        
"""
[[0, 0, 0], [1, 0, 0], [0, 1, 0], [1, 1, 0], [0, 0, 1], [1, 0, 1], [0, 1, 1], [1, 1, 1]]
[[0, 0, 0, 0, 0], [1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [1, 1, 0, 0, 0], [0, 0, 1, 0, 0], [1, 0, 1, 0, 0], [0, 1, 1, 0, 0], [1, 1, 1, 0, 0], [0, 0, 0, 1, 0], [1, 0, 0, 1, 0], [0, 1, 0, 1, 0], [1, 1, 0, 1, 0], [0, 0, 1, 1, 0], [1, 0, 1, 1, 0], [0, 1, 1, 1, 0], [1, 1, 1, 1, 0], [0, 0, 0, 0, 1], [1, 0, 0, 0, 1], [0, 1, 0, 0, 1], [1, 1, 0, 0, 1], [0, 0, 1, 0, 1], [1, 0, 1, 0, 1], [0, 1, 1, 0, 1], [1, 1, 1, 0, 1], [0, 0, 0, 1, 1], [1, 0, 0, 1, 1], [0, 1, 0, 1, 1], [1, 1, 0, 1, 1], [0, 0, 1, 1, 1], [1, 0, 1, 1, 1], [0, 1, 1, 1, 1], [1, 1, 1, 1, 1]]
"""

"""
Binary solution

Disk positions may be determined more directly from the binary (base 2) representation of the move number (the initial state being move #0, with all digits 0, and the final state being #2n?1, with all digits 1), using the following rules:

    There is one binary digit (bit) for each disk
    The most significant (leftmost) bit represents the largest disk. A value of 0 indicates that the largest disk is on the initial peg, while a 1 indicates that it's on the final peg.
    The bitstring is read from left to right, and each bit can be used to determine the location of the corresponding disk.
    A bit with the same value as the previous one means that the corresponding disk is stacked on top the previous disk on the same peg.
        (That is to say: a straight sequence of 1's or 0's means that the corresponding disks are all on the same peg).
    A bit with a different value to the previous one means that the corresponding disk is one position to the left or right of the previous one. Whether it is left or right is determined by this rule:
        Assume that the initial peg is on the left and the final peg is on the right.
        Also assume "wrapping" - so the right peg counts as one peg "left" of the left peg, and vice versa.
        Let n be the number of greater disks that are located on the same peg as their first greater disk and add 1 if the largest disk is on the left peg. If n is even, the disk is located one peg to the left, if n is odd, the disk located one peg to the right.

For example, in an 8-disk Hanoi:

    Move 0 = 00000000
        The largest disk is 0, so it is on the left (initial) peg.
        All other disks are 0 as well, so they are stacked on top of it. Hence all disks are on the initial peg.
    Move 28-1 = 11111111
        The largest disk is 1, so it is on the right (final) peg.
        All other disks are 1 as well, so they are stacked on top of it. Hence all disks are on the final peg and the puzzle is complete.
    Move 21610 = 11011000
        The largest disk is 1, so it is on the right (final) peg.
        Disk two is also 1, so it is stacked on top of it, on the right peg.
        Disk three is 0, so it is on another peg. Since n is odd(n=3), it is one peg to the right, i.e. on the left peg.
        Disk four is 1, so it is on another peg. Since n is even(n=2), it is one peg to the left, i.e. on the right peg.
        Disk five is also 1, so it is stacked on top of it, on the right peg.
        Disk six is 0, so it is on another peg. Since n is odd(n=5), the disk is one peg to the right, i.e. on the left peg.
        Disks seven and eight are also 0, so they are stacked on top of it, on the left peg.

The source and destination pegs for the mth move can also be found elegantly from the binary representation of m using bitwise operations. To use the syntax of the C programming language, move m is from peg (m&m-1)%3 to peg ((m|m-1)+1)%3, where the disks begin on peg 0 and finish on peg 1 or 2 according as whether the number of disks is even or odd. Another formulation is from peg (m-(m&-m))%3 to peg (m+(m&-m))%3.

Furthermore the disk to be moved is determined by the number of times the move count (m) can be divided by 2 (i.e. the number of zero bits at the right), counting the first move as 1 and identifying the disks by the numbers 0, 1, 2 etc. in order of increasing size. This permits a very fast non-recursive computer implementation to find the positions of the disks after m moves without reference to any previous move or distribution of disks.

The count trailing zeros (ctz) operation, which counts the number of consecutive zeros at the end of a binary number, gives a simple solution to the problem: the disks are numbered from zero, and at move m, disk number ctz(m) is moved the minimum possible distance to the right (circling back around to the left as needed).[9]
http://en.wikipedia.org/wiki/Tower_of_Hanoi
"""

Sunday, August 24, 2014

Linear Sum Subset Problem Algorithm P=NP (code)

Python there is overflow (bug), strongly recommend http://sagemath.org 
used to test the P=NP algorithms @sagemath
(http://twitter.com/maxtuno/status/504016698945851392) 
 
 The source code https://github.com/maxtuno/Universal 
 
#!/usr/bin/env python3

"""
One of these elementary operations +, *, -, / can replace tons and tons of computational process, that is P = NP. - O. A. Riveros
"""

__author__ = "O. A. Riveros"
__copyright__ = "Copyright 2014, O. A. Riveros, All right reserved"
__license__ = "MIT"
__email__ = "oscar.riveros@gmail.com"

"""
O. A. Riveros
http://independent.academia.edu/oarr
http://twitter.com/maxtuno
"""

"""
first 100 primes
"""
data = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541]

solution = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]

"""
for custom entertainment
solution = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
"""

target = sum([data[i] for i in range(len(solution)) if solution[i] == 1])

l = len(data)

size = len('{0:b}'.format(sum(data)))

def rotate(l,n):
    return l[n:] + l[:n]

def slice(l, n):
    return list(int(l[i:i+n], 2) for i in range(0, len(l), n))

data_second_order = []
for i in range(l):
    data_second_order += rotate(data, i)

T = 0
for i in range(l):
    T += int(''.join('{0:b}'.format(k).zfill(size) for k in rotate(data_second_order, i)), 2)
    t = slice('{0:b}'.format(T).zfill(size*(l**2)), size)
    if (target in t):
        '''
        for review the results
        print('The target {} found in {} steps from {}.'.format(target, i + 1, t))
        '''
        print('The target {} found in {} steps'.format(target, i + 1))
        break

"""
The target 24133 found in 100 steps
"""
"""
To use the algorithm with larger integers, you just have to adapt the cutout dimensions.
"""

https://github.com/maxtuno/Universal/blob/master/linear_sum_subset_algorithm_oscar_riveros.py

Monday, August 18, 2014

Factorization of large primes are trivial with P = NP

With P = NP, the factorization of large primes is trivial, an example for large RSA numbers.

http://pic.twitter.com/cCCbW2Icrm
http://independent.academia.edu/oarr

For factorizing a number any of these 'bases' (exclusive of each number) is an Universal factor and can be traduces to decimal factors i.e p*q (with p, q prime numbers) have many factors than only p*q in my Universal Number Theory - Copyrightc (c) 2013 -2014 Oscar Riveros, All right reserved. The factorization of large primes are trivial, P = NP