Friday, October 30, 2015

Testing the Domino Method of General Integer/Continuous/Mixed Nonlinear Programming with Brown’s Almost Linear System of 1000 Equations/Unknowns

Jsun Yui Wong

"Solving systems of nonlinear equations is perhaps the most difficult problem in all of numerical computations," Rice [6, 1993, p. 355].

"We make an extreme, but wholly defensible, statement: There are no good, general methods for solving systems of more than one nonlinear equation. Furthermore, it is not hard to see why (very likely) there never will be any good, general methods," Press, Teukolsky, Vetterling, and Flannery [5, 2007, p. 473].

Using qb64v1000-win [7, 9], the following computer program seeks to solve simultaneously Brown's almost linear system of 1000 equations; see Morgan [4, page 15], Floudas [2, page 660], and the preceding paper.  While line 128 of the preceding paper is 128 FOR I = 1 TO 100000 STEP 1, here line 128 is 128 FOR I = 1 TO 400000 STEP 1.

0 DEFDBL A-Z
3 DEFINT J, K

4 DIM X(1003), A(1003), L(1003), K(1003)


5 FOR JJJJ = -32000 TO 32000
    14 RANDOMIZE JJJJ
    16 M = -1D+17
    91 FOR KK = 1 TO 1000


        94 A(KK) = RND * 5


    95 NEXT KK

    128 FOR I = 1 TO 400000 STEP 1


        129 FOR K = 1 TO 1000


            131 X(K) = A(K)
        132 NEXT K

        155 FOR IPP = 1 TO FIX(1 + RND * 3)
            181 B = 1 + FIX(RND * 1000)


            183 R = (1 - RND * 2) * A(B)

            187 IF RND < .25 THEN X(B) = A(B) + RND * R ELSE IF RND < .333 THEN X(B) = A(B) + RND ^ 4 * R ELSE IF RND < .5 THEN X(B) = A(B) + RND ^ 7 * R ELSE X(B) = CINT(A(B))

        191 NEXT IPP


        301 prodd = 1



        305 FOR j55 = 2 TO 1000



            311 prodd = prodd * X(j55)


        321 NEXT j55

        371 IF prodd < .00001 THEN 1670


        389 X(1) = (1) / prodd


        501 summ = 0
        505 FOR j27 = 1 TO 1000



            511 summ = summ + X(j27)

        521 NEXT j27



        901 DIFF = 0


        905 FOR J77 = 1 TO 999


            911 DIFF = DIFF - ABS(X(J77) + summ - 1001)


        921 NEXT J77


        995 P = DIFF


        1451 IF P <= M THEN 1670
        1657 FOR KEW = 1 TO 1000



            1658 A(KEW) = X(KEW)
        1659 NEXT KEW
        1661 M = P
    1670 NEXT I
    1890 IF M < -.000001 THEN 1999


    1912 PRINT A(1), A(2), A(3)


    1933 PRINT A(997), A(998), A(999)


    1939 PRINT A(1000), M, JJJJ

1999 NEXT JJJJ

This computer program was run with qb64v1000-win [7, 8]. Copied by hand from the screen, the computer program’s complete output through
JJJJ= -31992 is shown below.

.9999999983488452         1        1
1         1         1
1        -5.462564678371251D-08         -32000

1.000000000028562           1          1
1         1         1
1               -8.066667445127962D-09            -31998

.9999999994479734            1               1
1.000000000296977            1               1
1.000000000005344           -1.147819295166386D-08           -31992

Above there is no rounding by hand; it is just straight copying by hand from the screen.

Of the 1000 values for the 1000 unknowns, only the 7 A's of line 1912, line 1933, and line 1939 of the computer program above are shown above.

On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and with qb64v1000-win [7, 8], the wall-clock time for obtaining the output through JJJJ= -31992 was ten minutes.

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] R. L. Burden, J. D. Faires. Numerical Analysis, Fifth Edition. PWS Publishing Company, 1993.

[2] C. A. Floudas, Deterministic Global Optimization. Kluwer Academic Publishers, 2000.

[3] Microsoft Corp. BASIC, second edition (May 1982), Version 1.10. Boca Raton, Florida: IBM Corp., Personal Computer, P. O. Box 1328-C, Boca Raton, Florida 33432, 1981.

[4] Alexander P. Morgan, A Method for Computing All Solutions to Systems of Polynomial Equations, ACM Transactions on Mathematical Software, Vol. 9, No. 1, March 1983, Pages 1-17. https://folk.uib.no/ssu029/pdf_file/Morgan83.pdf

[5] W. H. Press, S. A. Teukolsky, W. T. Vetterling, B. P. Flannery. Numerical recipes: the art of scientific computing, third ed. Cambridge University Press, 2007.

[6] J. Rice. Numerical Methods, Software, and Analysis, Second Edition. Academic Press, 1993.

[7] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY! issue70/#galleoninterview

[8] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64

Thursday, October 29, 2015

Testing the Domino Method of General Integer/Continuous/Mixed Nonlinear Programming with Brown’s Almost Linear System of 200 Equations/Unknowns

Jsun Yui Wong

"Solving systems of nonlinear equations is perhaps the most difficult problem in all of numerical computations," Rice [6, 1993, p. 355].

"We make an extreme, but wholly defensible, statement: There are no good, general methods for solving systems of more than one nonlinear equation. Furthermore, it is not hard to see why (very likely) there never will be any good, general methods," Press, Teukolsky, Vetterling, and Flannery [5, 2007, p. 473].

Using qb64v1000-win [7, 9], the following computer program seeks to solve simultaneously Brown's almost linear system of 200 equations; see Morgan [4, page 15], Floudas [2, page 660], and the preceding paper.

0 DEFDBL A-Z
3 DEFINT J, K

4 DIM X(203), A(203), L(203), K(203)


5 FOR JJJJ = -32000 TO 32000
    14 RANDOMIZE JJJJ
    16 M = -1D+17
    91 FOR KK = 1 TO 200


        94 A(KK) = RND * 5


    95 NEXT KK

    128 FOR I = 1 TO 100000 STEP 1


        129 FOR K = 1 TO 200


            131 X(K) = A(K)
        132 NEXT K

        155 FOR IPP = 1 TO FIX(1 + RND * 3)
            181 B = 1 + FIX(RND * 200)


            183 R = (1 - RND * 2) * A(B)

            187 IF RND < .25 THEN X(B) = A(B) + RND * R ELSE IF RND < .333 THEN X(B) = A(B) + RND ^ 4 * R ELSE IF RND < .5 THEN X(B) = A(B) + RND ^ 7 * R ELSE X(B) = CINT(A(B))

        191 NEXT IPP


        301 prodd = 1



        305 FOR j55 = 2 TO 200


            311 prodd = prodd * X(j55)


        321 NEXT j55

        371 IF prodd < .00001 THEN 1670


        389 X(1) = (1) / prodd


        501 summ = 0
        505 FOR j27 = 1 TO 200


            511 summ = summ + X(j27)

        521 NEXT j27



        901 DIFF = 0


        905 FOR J77 = 1 TO 199



            911 DIFF = DIFF - ABS(X(J77) + summ - 201)


        921 NEXT J77


        995 P = DIFF


        1451 IF P <= M THEN 1670
        1657 FOR KEW = 1 TO 200



            1658 A(KEW) = X(KEW)
        1659 NEXT KEW
        1661 M = P
    1670 NEXT I
    1890 IF M < -.000001 THEN 1999


    1912 PRINT A(1), A(2), A(3)


    1933 PRINT A(197), A(198), A(199)


    1939 PRINT A(200), M, JJJJ

1999 NEXT JJJJ

This computer program was run with qb64v1000-win [7, 8]. Copied by hand from the screen, the computer program’s complete output through
JJJJ= -31994 is shown below.

1         1         1
1         1         1
1         0         -32000

1         1         1
1         1         1
1         0         -31998

1.000000020302394        1            1
1         1         1
1         -1.961725415444704D-07         -31995

1         1         1
1         1         1
1         0         -31994

Above there is no rounding by hand; it is just straight copying by hand from the screen.

Of the 200 values for the 200 unknowns, only the 7 A's of line 1912, line 1933, and line 1939 of the computer program above are shown above.

On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and with qb64v1000-win [7, 8], the wall-clock time for obtaining the output through JJJJ= -31991 was 45 seconds.

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] R. L. Burden, J. D. Faires. Numerical Analysis, Fifth Edition. PWS Publishing Company, 1993.

[2] C. A. Floudas, Deterministic Global Optimization. Kluwer Academic Publishers, 2000.

[3] Microsoft Corp. BASIC, second edition (May 1982), Version 1.10. Boca Raton, Florida: IBM Corp., Personal Computer, P. O. Box 1328-C, Boca Raton, Florida 33432, 1981.

[4] Alexander P. Morgan, A Method for Computing All Solutions to Systems of Polynomial Equations, ACM Transactions on Mathematical Software, Vol. 9, No. 1, March 1983, Pages 1-17. https://folk.uib.no/ssu029/pdf_file/Morgan83.pdf

[5] W. H. Press, S. A. Teukolsky, W. T. Vetterling, B. P. Flannery. Numerical recipes: the art of scientific computing, third ed. Cambridge University Press, 2007.

[6] J. Rice. Numerical Methods, Software, and Analysis, Second Edition. Academic Press, 1993.

[7] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY! issue70/#galleoninterview

[8] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64

Wednesday, October 28, 2015

Testing the Domino Method of General Integer/Continuous/Mixed Nonlinear Programming with Brown’s Almost Linear System of Sixty Equations

Jsun Yui Wong

"Solving systems of nonlinear equations is perhaps the most difficult problem in all of numerical computations," Rice [6, 1993, p. 355].

"We make an extreme, but wholly defensible, statement: There are no good, general methods for solving systems of more than one nonlinear equation. Furthermore, it is not hard to see why (very likely) there never will be any good, general methods," Press, Teukolsky, Vetterling, and Flannery [5, 2007, p. 473].

Using qb64v1000-win [7, 9], the following computer program seeks to solve simultaneously Brown's almost linear system of sixty equations; see Morgan [4, page 15], Floudas [2, page 660], and the preceding paper.

0 DEFDBL A-Z
3 DEFINT J, K

4 DIM X(63), A(63), L(63), K(63)



5 FOR JJJJ = -32000 TO 32000
    14 RANDOMIZE JJJJ
    16 M = -1D+17
    91 FOR KK = 1 TO 60



        94 A(KK) = RND * 5


    95 NEXT KK

    128 FOR I = 1 TO 100000 STEP 1


        129 FOR K = 1 TO 60


            131 X(K) = A(K)
        132 NEXT K

        155 FOR IPP = 1 TO FIX(1 + RND * 3)
            181 B = 1 + FIX(RND * 60)


            183 R = (1 - RND * 2) * A(B)

            187 IF RND < .25 THEN X(B) = A(B) + RND * R ELSE IF RND < .333 THEN X(B) = A(B) + RND ^ 4 * R ELSE IF RND < .5 THEN X(B) = A(B) + RND ^ 7 * R ELSE X(B) = CINT(A(B))

        191 NEXT IPP


        301 prodd = 1



        305 FOR j55 = 2 TO 60



            311 prodd = prodd * X(j55)


        321 NEXT j55

        371 IF prodd < .00001 THEN 1670


        389 X(1) = (1) / prodd


        501 summ = 0
        505 FOR j27 = 1 TO 60


            511 summ = summ + X(j27)

        521 NEXT j27



        901 DIFF = 0


        905 FOR J77 = 1 TO 59



            911 DIFF = DIFF - ABS(X(J77) + summ - 61)



        921 NEXT J77



        995 P = DIFF


        1451 IF P <= M THEN 1670
        1657 FOR KEW = 1 TO 60



            1658 A(KEW) = X(KEW)
        1659 NEXT KEW
        1661 M = P
    1670 NEXT I
    1890 IF M < -.000001 THEN 1999



    1912 PRINT A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8), A(9), A(10), A(11), A(12), A(13), A(14), A(15)
    1914 PRINT A(16), A(17), A(18), A(19), A(20), A(21), A(22), A(23), A(24), A(25)

    1917 PRINT A(26), A(27), A(28), A(29), A(30), A(31), A(32), A(33), A(34), A(35)

    1922 PRINT A(36), A(37), A(38), A(39), A(40), A(41), A(42), A(43), A(44), A(45)

    1925 PRINT A(46), A(47), A(48), A(49), A(50), A(51), A(52), A(53), A(54), A(55)


    1929 PRINT A(56), A(57), A(58), A(59), A(60), M, JJJJ

1999 NEXT JJJJ
     

This computer program was run with qb64v1000-win [7, 8]. Copied by hand from the screen, the computer program’s output through
JJJJ= -31886 is summarized below.

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
0            -32000

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
0            -31999

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
0            -31997

.
.
.


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
0           -31889

1.00000002657883                 1.000000048624531                 1
1.000000027520822               .9999999999999653                   1.000000025377933
1.00000000796407                 1                            1.000000000000001
1      1      1      1      1
1
1.000000001983348           1               1            1
1          1             1             1                1.000000003284678
1
1             1.00000003035104             1.000000020679731
1         1          1            1                     1.000000021340572
1.00000000257795          1.000000028881227
1.00000000575935            1     1       1
1             1.00000000185054             1.00000000994491
1            1                      1.000000000008875
1             1.000000034603001           1.00000008229818  .
1.000000024426821         1.00000005166799            1
1.000000006142258         1.000000001082351            1.000000014002086
1
1                  1                  1                                        1.000000009768956
.9999995132701194             -4.867354576054694D-07                         -31888

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
0            -31886

Above there is no rounding by hand; it is just straight copying by hand from the screen.

On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and with qb64v1000-win [7, 8], the wall-clock time for obtaining the output through JJJJ= -31886 was three minutes.

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] R. L. Burden, J. D. Faires. Numerical Analysis, Fifth Edition. PWS Publishing Company, 1993.

[2] C. A. Floudas, Deterministic Global Optimization. Kluwer Academic Publishers, 2000.

[3] Microsoft Corp. BASIC, second edition (May 1982), Version 1.10. Boca Raton, Florida: IBM Corp., Personal Computer, P. O. Box 1328-C, Boca Raton, Florida 33432, 1981.

[4] Alexander P. Morgan, A Method for Computing All Solutions to Systems of Polynomial Equations, ACM Transactions on Mathematical Software, Vol. 9, No. 1, March 1983, Pages 1-17. https://folk.uib.no/ssu029/pdf_file/Morgan83.pdf

[5] W. H. Press, S. A. Teukolsky, W. T. Vetterling, B. P. Flannery. Numerical recipes: the art of scientific computing, third ed. Cambridge University Press, 2007.

[6] J. Rice. Numerical Methods, Software, and Analysis, Second Edition. Academic Press, 1993.

[7] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY! issue70/#galleoninterview

[8] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64

Tuesday, October 27, 2015

Testing the Domino Method of General Integer Nonlinear Programming with Brown’s Almost Linear System of Twenty Equations

Jsun Yui Wong

The following computer program seeks to solve simultaneously Brown's almost linear system of twenty equations; see Morgan [3, page 15], Floudas [1, page 660], and the preceding paper.

The following computer program uses qb64v1000-win [5, 6].

0 DEFDBL A-Z
3 DEFINT J, K

4 DIM X(42), A(42), L(33), K(33)
5 FOR JJJJ = -32000 TO 32000
    14 RANDOMIZE JJJJ
    16 M = -1D+17
    91 FOR KK = 1 TO 20


        94 A(KK) = RND * 5


    95 NEXT KK

    128 FOR I = 1 TO 100000 STEP 1
        129 FOR K = 1 TO 20

            131 X(K) = A(K)
        132 NEXT K

        155 FOR IPP = 1 TO FIX(1 + RND * 3)
            181 B = 1 + FIX(RND * 20)

            183 R = (1 - RND * 2) * A(B)

            187 IF RND < .25 THEN X(B) = A(B) + RND * R ELSE IF RND < .333 THEN X(B) = A(B) + RND ^ 4 * R ELSE IF RND < .5 THEN X(B) = A(B) + RND ^ 7 * R ELSE X(B) = CINT(A(B))

        191 NEXT IPP



        391 IF (X(2) * X(3) * X(4) * X(5) * X(6) * X(7) * X(8) * X(9) * X(10) * X(11) * X(12) * X(13) * X(14) * X(15) * X(16) * X(17) * X(18) * X(19) * X(20)) < .001 THEN 1670



        401 X(1) = (1) / (X(2) * X(3) * X(4) * X(5) * X(6) * X(7) * X(8) * X(9) * X(10) * X(11) * X(12) * X(13) * X(14) * X(15) * X(16) * X(17) * X(18) * X(19) * X(20))



        501 summ = 0
        505 FOR j27 = 1 TO 20


            511 summ = summ + X(j27)

        521 NEXT j27


        881 P = -ABS(X(1) + summ - 21) - ABS(X(2) + summ - 21) - ABS(X(3) + summ - 21) - ABS(X(4) + summ - 21) - ABS(X(5) + summ - 21) - ABS(X(6) + summ - 21) - ABS(X(7) + summ - 21) - ABS(X(8) + summ - 21) - ABS(X(9) + summ - 21) - ABS(X(10) + summ - 21) - ABS(X(11) + summ - 21) - ABS(X(12) + summ - 21) - ABS(X(13) + summ - 21) - ABS(X(14) + summ - 21) - ABS(X(15) + summ - 21) - ABS(X(16) + summ - 21) - ABS(X(17) + summ - 21) - ABS(X(18) + summ - 21) - ABS(X(19) + summ - 21)


        1451 IF P <= M THEN 1670
        1657 FOR KEW = 1 TO 20

            1658 A(KEW) = X(KEW)
        1659 NEXT KEW
        1661 M = P
    1670 NEXT I
    1890 IF M < -.00001 THEN 1999


    1912 PRINT A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8), A(9), A(10), A(11), A(12), A(13), A(14)

    1915 PRINT A(15), A(16), A(17), A(18), A(19), A(20), M, JJJJ

1999 NEXT JJJJ

This computer program was run with qb64v1000-win [5, 6]. Copied by hand from the screen, the computer program’s complete output through
JJJJ= -31974 is shown below.

1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -32000

1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31999
1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31998

1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31997

1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31996
1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31995

1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31992

1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31991
1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31988

1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31987

1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31986
1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31985

1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31984

1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31983
1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31981

1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31980

1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31979

1.00000002405578               1.000000005919952                                          1
1.000000051201943             1.000000013496996                                          1.00000006141003
1.00000004830274               1.000000042790504                                          1.000000025578463
1                  1.00000007854793            1.000000120518811
1.000000117993434             1.000000123710394
1.00000002889907               1.0000001420905                1
1.00000006831842       1.000000099978106          .9999989471875357
-1.052824407210551D-06            -31978

1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31976

1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31975

1       1       1       1       1
1       1       1       1       1
1       1       1       1      
1       1       1       1       1
1         0         -31974

Above there is no rounding by hand; it is just straight copying by hand from the screen.

On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and with qb64v1000-win [5, 6], the wall-clock time for obtaining the output through JJJJ= -31974 was five minutes.

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] C. A. Floudas, Deterministic Global Optimization. Kluwer Academic Publishers, 2000.

[2] Microsoft Corp. BASIC, second edition (May 1982), Version 1.10. Boca Raton, Florida: IBM Corp., Personal Computer, P. O. Box 1328-C, Boca Raton, Florida 33432, 1981.

[3] Alexander P. Morgan, A Method for Computing All Solutions to Systems of Polynomial Equations, ACM Transactions on Mathematical Software, Vol. 9, No. 1, March 1983, Pages 1-17. https://folk.uib.no/ssu029/pdf_file/Morgan83.pdf

[4] W. H. Press, S. A. Teukolsky, W. T. Vetterling, B. P. Flannery. Numerical recipes: the art of scientific computing, third ed. Cambridge University Press, 2007.

[5] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY! issue70/#galleoninterview

[6] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64

Wednesday, October 21, 2015

Testing the Domino Method of General Integer Nonlinear Programming with Brown’s Almost Linear System of Nine Equations

Jsun Yui Wong

The following computer program seeks to solve the following system of nine equations; see Morgan [3, page 15] and Floudas [1, page 660].  The problem is to solve simultaneously

       X(1) * X(2) * X(3) * X(4) * X(5) * X(6) * X(7) * X(8) * X(9) - 1  =  0

       2 * X(1) + X(2) + X(3) + X(4) + X(5) + X(6) + X(7) + X(8) + X(9) - 10  = 0

       X(1) +2 * X(2) + X(3) + X(4) + X(5) + X(6) + X(7) + X(8) + X(9) - 10   = 0

       X(1) + X(2) + 2 * X(3) + X(4) + X(5) + X(6) + X(7) + X(8) + X(9) - 10 = 0

       X(1) + X(2) + X(3) + 2 * X(4) + X(5) + X(6) + X(7) + X(8) + X(9) - 10 = 0

       X(1) + X(2) + X(3) + X(4) + 2 * X(5) + X(6) + X(7) + X(8) + X(9) - 10 = 0

       X(1) + X(2) + X(3) + X(4) + X(5) + 2 * X(6) + X(7) + X(8) + X(9) - 10 = 0

       X(1) + X(2) + X(3) + X(4) + X(5) + X(6) + 2 * X(7) + X(8) + X(9) - 10 = 0

       X(1) + X(2) + X(3) + X(4) + X(5) + X(6) + X(7) + 2 * X(8) + X(9) - 10 = 0
       
The following computer program uses qb64v1000-win [5, 6].

0 DEFDBL A-Z
3 DEFINT J, K

4 DIM X(42), A(42), L(33), K(33)
5 FOR JJJJ = -32000 TO 32000

    14 RANDOMIZE JJJJ
    16 M = -1D+17
    91 FOR KK = 1 TO 9


        94 A(KK) = -10 + RND * 20


    95 NEXT KK


    128 FOR I = 1 TO 60000 STEP 1


        129 FOR K = 1 TO 9


            131 X(K) = A(K)
        132 NEXT K

        155 FOR IPP = 1 TO FIX(1 + RND * 3)

            181 B = 1 + FIX(RND * 9)

            183 R = (1 - RND * 2) * A(B)


            187 IF RND < .25 THEN X(B) = A(B) + RND * R ELSE IF RND < .333 THEN X(B) = A(B) + RND ^ 4 * R ELSE IF RND < .5 THEN X(B) = A(B) + RND ^ 7 * R ELSE X(B) = CINT(A(B))

        191 NEXT IPP
        195 X(1) = -2## * X(2) - X(3) - X(4) - X(5) - X(6) - X(7) - X(8) - X(9) + 10##


        222 N1 = 2## * X(1) + X(2) + X(3) + X(4) + X(5) + X(6) + X(7) + X(8) + X(9) - 10##


        224 N3 = X(1) + X(2) + 2## * X(3) + X(4) + X(5) + X(6) + X(7) + X(8) + X(9) - 10##
        225 N4 = X(1) + X(2) + X(3) + 2## * X(4) + X(5) + X(6) + X(7) + X(8) + X(9) - 10##


        226 N8 = X(1) + X(2) + X(3) + X(4) + 2## * X(5) + X(6) + X(7) + X(8) + X(9) - 10##

        228 N9 = X(1) + X(2) + X(3) + X(4) + X(5) + 2## * X(6) + X(7) + X(8) + X(9) - 10##

        231 NZ = X(1) + X(2) + X(3) + X(4) + X(5) + X(6) + 2## * X(7) + X(8) + X(9) - 10##


        232 NL = X(1) + X(2) + X(3) + X(4) + X(5) + X(6) + X(7) + 2## * X(8) + X(9) - 10##


        233 N5 = X(1) * X(2) * X(3) * X(4) * X(5) * X(6) * X(7) * X(8) * X(9) - 1##


        1230 P = -ABS(N1) - ABS(N3) - ABS(N4) - ABS(N5) - ABS(N8) - ABS(N9) - ABS(NZ) - ABS(NL)


        1451 IF P <= M THEN 1670
        1657 FOR KEW = 1 TO 9


            1658 A(KEW) = X(KEW)
        1659 NEXT KEW
        1661 M = P
    1670 NEXT I
    1890 IF M < -.005 THEN 1999

    1912 PRINT A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8), A(9), M, JJJJ

1999 NEXT JJJJ

This computer program was run with qb64v1000-win [5, 6]. Copied by hand from the screen, the computer program’s complete output through
JJJJ= 32000 is shown below:

1         1         1         1         1
1         1         1         1         0
-27528

 .9743386025850583                 .9743386027383917                                          .9743385977227542
 .9743385967110256                 .9743386070307317                                          .974338600657202
 .9743386223574053                 .9743386013943338.                                         1.230952566064706
-1.82853374971903D-04                     -10040

1         1         1         1         1
1         1         1         1         0
-1391

 .9998829513994836                                       .9998829434625747                  .9998821558466593
 .9998828594920054                                       .9998829356715228                  .999883026305355
 .9998826220110612                                       .9998730372727007                  1.001064525076063
-1.276387574025548D-04                                6828

Above there is no rounding by hand; it is just straight copying by hand from the screen.

On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and with qb64v1000-win [5, 6], the wall-clock time for obtaining the output through JJJJ= 32000 was one hour and fifty minutes.

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] C. A. Floudas, Deterministic Global Optimization.  Kluwer Academic Publishers, 2000.

[2] Microsoft Corp. BASIC, second edition (May 1982), Version 1.10. Boca Raton, Florida: IBM Corp., Personal Computer, P. O. Box 1328-C, Boca Raton, Florida 33432, 1981.

[3]  Alexander P. Morgan,  A Method for Computing All Solutions to Systems of Polynomial Equations, ACM Transactions on Mathematical Software, Vol. 9, No. 1, March 1983, Pages 1-17.  https://folk.uib.no/ssu029/pdf_file/Morgan83.pdf

[4] W. H. Press, S. A. Teukolsky, W. T. Vetterling, B. P. Flannery. Numerical recipes: the art of scientific computing, third ed. Cambridge University Press, 2007.

[5] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY! issue70/#galleoninterview

[6] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64

Sunday, October 18, 2015

Finding Multiple Solutions of a Nonlinear System of Four Equations from the Literature, QB64 Edition

Jsun Yui Wong

"We make an extreme, but wholly defensible, statement: There are no good, general methods for solving systems of more than one nonlinear equation. Furthermore, it is not hard to see why (very likely) there never will be any good, general methods": Press, Teukolsky, Vetterling, and Flannery [3, 2007, p. 473].

Based on the computer program in Wong [6], , the following computer program tries to find multiple solutions of the following nonlinear system of equations from Burden and Faires [1, p. 559].

X(1)*X(2)*X(3)*X(4)-1=0
2*X(1)+X(2)+X(3)+X(4)-5=0
X(1)+2*X(2)+X(3)+X(4)-5=0
X(1)+X(2)+2*X(3)+X(4)-5=0

The following computer program uses qb64v1000-win [4, 5].

0 DEFDBL A-Z
3 DEFINT I, J, K
4 DIM X(42), A(42), L(33), K(33)
5 FOR JJJJ = -32000 TO 32000
    14 RANDOMIZE JJJJ
    16 M = -1D+17
    91 FOR KK = 1 TO 4
        94 A(KK) = -10 + RND * 20


    95 NEXT KK


    128 FOR I = 1 TO 20000


        129 FOR K = 1 TO 4
            131 X(K) = A(K)
        132 NEXT K

        155 FOR IPP = 1 TO FIX(1 + RND * 3)


            181 B = 1 + FIX(RND * 4)

            183 R = (1 - RND * 2) * A(B)


            187 IF RND < .333 THEN X(B) = A(B) + RND * R ELSE IF RND < .5 THEN X(B) = A(B) + RND ^ 4 * R ELSE X(B) = A(B) + RND ^ 7 * R


        211 NEXT IPP


        1141 X(1) = -2## * X(2) - X(3) - X(4) + 5##

        1142 N1 = 2## * X(1) + X(2) + X(3) + X(4) - 5##


        1145 N2 = X(1) + X(2) + 2## * X(3) + X(4) - 5##


        1150 N3 = X(1) * X(2) * X(3) * X(4) - 1##

        1230 P = -ABS(N1) - ABS(N2) - ABS(N3)


        1451 IF P <= M THEN 1670
        1657 FOR KEW = 1 TO 4
            1658 A(KEW) = X(KEW)
        1659 NEXT KEW
        1661 M = P
    1670 NEXT I
    1890 IF M < -.00001 THEN 1999


    1912 PRINT A(1), A(2), A(3), A(4), M, JJJJ

1999 NEXT JJJJ

This computer program was run with qb64v1000-win [4, 5]. Copied by hand from the screen, the computer program’s complete output through
JJJJ=  -17140 is shown below:

.868865346823489            .8688653468237607                .8688653469202664
1.524538612608723         -9.537550665978365D-06         -25909

.8688854102009361          .868885410311283                  .8688854107102401
1.524458358466258         -7.09426504664568D-06          -20487

1.000001450489441          1.000001449252298                 1.000001450135191
.9999942008707722         -1.451391252784752D-06         -17140

Above there is no rounding by hand; it is just straight copying by hand from the screen.

On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and with qb64v1000-win [4, 5], the wall-clock time for obtaining the output through JJJJ= -17140 was eleven minutes.

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] R. Burden, J. D. Faires. Numerical Analysis, Fifth Ed. PWS-Kent Publishing Company, 1993.

[2] Microsoft Corp. BASIC, second edition (May 1982), Version 1.10. Boca Raton, Florida: IBM Corp., Personal Computer, P. O. Box 1328-C, Boca Raton, Florida 33432, 1981.

[3] W. H. Press, S. A. Teukolsky, W. T. Vetterling, B. P. Flannery. Numerical Recipes: the Art of Scientific Computing, Third Ed. Cambridge University Press, 2007.

[4] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY! issue70/#galleoninterview

[5] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64

[6] Jsun Yui Wong (April 6, 2010).  Finding Multiple Solutions of a Nonlinear System of Four Equations from the Literature.
http://wongsnewnewblog.blogspot.ca/2010/04/finding-multiple-solutions-of-nonlinear.html

Wednesday, October 7, 2015

Testing the Nonlinear Integer Programming Solver with the 7.4.4 Diophantine Equation in Weisstein

Jsun Yui Wong

The computer program listed below seeks to solve the following 7.4.4 Diophantine equation from Weisstein [15].

X(1) ^ 7 + X(2) ^ 7 + X(3) ^ 7 + X(4) ^ 7   =   X(5) ^ 7 + X(6) ^ 7 + X(7) ^ 7   +    X(8) ^ 7

Weisstein [15]: "Guy (1994, p. 140) asked if a 7.4.4 equation exists."  See Guy [5].

The following computer program uses qb64v1000-win [13, 17].

0 DEFDBL A-Z
1 DEFINT I, K, A, X

2 DIM B(99), N(99), A(2002), H(99), L(99), U(99), X(2002), D(111), P(111), PS(33), J(99), AA(99), HR(32), HHR(32), PLHS(44), LB(22), UB(22), PX(44), J44(44), PN(22), NN(22)

88 FOR JJJJ = -32000 TO 32000 STEP .1


    89 RANDOMIZE JJJJ
    90 M = -3D+30
    111 FOR J44 = 1 TO 7

        112 A(J44) = 10 + (RND * 200)


    113 NEXT J44
    128 FOR I = 1 TO 15000

        129 FOR KKQQ = 1 TO 8


            130 X(KKQQ) = A(KKQQ)
        131 NEXT KKQQ
        139 FOR IPP = 1 TO FIX(1 + RND * 3)

            140 B = 1 + FIX(RND * 7)


            150 R = (1 - RND * 2) * A(B)
            155 IF RND < .5 THEN 160 ELSE GOTO 167
            160 X(B) = (A(B) + RND ^ 3 * R)
            165 GOTO 168

            167 IF RND < .5 THEN X(B) = CINT(A(B) - 1) ELSE X(B) = CINT(A(B) + 1)
        168 NEXT IPP

        185 FOR J44 = 1 TO 7


            186 IF X(J44) > 155 THEN X(J44) = 50 + FIX(RND * 200)


            187 IF X(J44) < 1 THEN X(J44) = 1 + FIX(RND * 20)


        188 NEXT J44

        189 FOR JJ11 = 1 TO 7


            190 FOR JN = JJ11 + 1 TO 8


                191 IF X(JJ11) = X(JN) THEN 1670

            192 NEXT JN

        193 NEXT JJ11
        194 IF ((X(1) ^ 7# + X(2) ^ 7# + X(3) ^ 7# + X(4) ^ 7# - X(5) ^ 7# - X(6) ^ 7# - X(7) ^ 7#)) < 0 THEN 1670

        195 X(8) = ((X(1) ^ 7# + X(2) ^ 7# + X(3) ^ 7# + X(4) ^ 7# - X(5) ^ 7# - X(6) ^ 7# - X(7) ^ 7#)) ^ .1428571428571428571428571428571428571428##


        211 N(7) = X(8) ^ 7# - X(1) ^ 7# - X(2) ^ 7# - X(3) ^ 7# - X(4) ^ 7# + X(5) ^ 7# + X(6) ^ 7# + X(7) ^ 7#

        322 PD1 = -ABS(N(7))
        1111 IF PD1 <= M THEN 1670
        1452 M = PD1
        1454 FOR KLX = 1 TO 8


            1455 A(KLX) = X(KLX)

        1459 NEXT KLX

        1557 GOTO 128
    1670 NEXT I
    1889 IF M < -4990 THEN 1999


    1904 PRINT A(1), A(2), A(3), A(4)

    1905 PRINT A(5), A(6), A(7)

    1906 PRINT A(8), M, JJJJ

1999 NEXT JJJJ

This computer program was run with qb64v1000-win [13, 17]. Copied by hand from the screen, the computer program’s complete output through
JJJJ= -31586.80000000601 is shown below:

15     140      9      113
66      144     30
16         -1785         -31707.60000000426

16       109       32      74
107        65         84
17          -4368        -31649.5000000051

129      90      15      146
10      123      149
14         0               -31586.80000000601    

Above there is no rounding by hand; it is just straight copying by hand from the screen.

The solution shown above at JJJJ=  -31586.80000000601 with M=0 is the same as one of the three solutions presented in Weisstein [15].

One notes that 149^7=1630436461403549.

On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and with qb64v1000-win [13, 17], the wall-clock time for obtaining the output through
JJJJ=  -31586.80000000601 was ten minutes.

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] S. Abraham, S. Sanyal, M. Sanglikar (2013), Finding Numerical Solutions of Diophantine Equations Using Ant Colony Optimization. Applied Mathematics and Computation 219 (2013), pages 11376-11387.

[2] J. L. Brenner, Lorraine L. Foster (1982), Exponential Diophantine Equations. Pacific Journal of Mathematics, Volume 101, Number 2, 1982, Pages 263-301.

[3] Martin Gardner (1979), Mathematical Games. Scientific American, 241 (3), Page 25.

[4] Martin Gardner (1983), Diophantine Analysis and Fermat’s Last Theorem, Chapter 2 of Wheels, Life and Other Mathematical Amusements. New York, San Francisco: W. H. Freeman and Company (1983). http://www.labeee.ufsc.br/~luis/ga/Gardner.pdf

[5]  R. K. Guy, "Sums of Like Powers. Euler's Conjecture." §D1 in Unsolved Problems in Number Theory, 2nd ed. New York: Springer-Verlag, pp. 139-144, 1994.

[6] L. J. Lander, T. R. Parkin (1966), Counterexample to Euler’s Conjecture on Sums of Like Powers. The Bulletin of American Mathematical Society, Vol. 72, 1966, page 1079.

[7] L. J. Lander, T. R. Parkin (1967), A Counterexample to Euler’s Sum of Powers Conjecture. Mathematics of Computation, Vol. 21, January 1967, pages 101-103.

[8] L. J. Lander, T. R. Parkin, J. L. Selfridge (1967), A Survey of Equal Sums of Like Powers. Mathematics of Computation, Vol. 21, July 1967, pages 446-459.

[9] Microsoft Corp., BASIC, Second Edition (May 1982), Version 1.10. Boca Raton, Florida: IBM Corp., Personal Computer, P. O. Box 1328-C, Boca Raton, Florida 33432, 1981.

[10] O. Perez, I. Amaya, R. Correa (2013), Numerical Solution of Certain Exponential and Non-linear Diophantine Systems of Equations by Using a Discrete Particles Swarm Optimization Algorithm. Applied Mathematics and Computation, Volume 225, 1 December 2013, Pages 737-746.

[11] Tito Piezas III, Euler Bricks and Quadruples. http://sites.google.com/site/tpiezas/0021

[12] W. Sierpinski, A Selection of Problems in the Theory of Numbers. New York: The McMillan Company, 1964.

[13] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY!issue70/#galleoninterview

[14] Michel Waldschmidt, Open Diophantine Problems. Moscow Mathematical Journal, Volume 4, Number 1, January-March 2004, Pages 245-305.

[15] Eric W. Weisstein. "Diophantine Equation--7th Powers."  From MathWorld--A Wolfram Web Resource.
http://mathworld.wolfram.com/DiophantineEquation7thPowers.html

[16] Wikipedia, Euler's sum of powers conjecture. https://en.wikipedia.org/wiki/Euler%27s_sum_of_powers_conjecture

[17] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64

Monday, October 5, 2015

Testing the Nonlinear Integer Programming Solver with the 7.1.9 Diophantine Equation Presented in Weisstein

Jsun Yui Wong

The computer program listed below seeks to solve the following 7.1.9 Diophantine equation presented in Weisstein [14].

X(1) ^ 7 + X(2) ^ 7 + X(3) ^ 7 + X(4) ^ 7 + X(5) ^ 7   +    X(6) ^ 7 + X(7) ^ 7 + X(8) ^ 7 + X(9) ^ 7  =  X(10) ^ 7

The following computer program uses qb64v1000-win [12, 16].

0 DEFDBL A-Z
1 DEFINT I, K, A, X

2 DIM B(99), N(99), A(2002), H(99), L(99), U(99), X(2002), D(111), P(111), PS(33), J(99), AA(99), HR(32), HHR(32), PLHS(44), LB(22), UB(22), PX(44), J44(44), PN(22), NN(22)


88 FOR JJJJ = -32000 TO 32000 STEP .1


    89 RANDOMIZE JJJJ
    90 M = -3D+30
    111 FOR J44 = 1 TO 9


        112 A(J44) = 1 + FIX(RND * 100)


    113 NEXT J44
    128 FOR I = 1 TO 5000



        129 FOR KKQQ = 1 TO 10



            130 X(KKQQ) = A(KKQQ)
        131 NEXT KKQQ
        139 FOR IPP = 1 TO FIX(1 + RND * 3)


            140 B = 1 + FIX(RND * 9)



            150 R = (1 - RND * 2) * A(B)
            155 IF RND < .5 THEN 160 ELSE GOTO 167
            160 X(B) = (A(B) + RND ^ 3 * R)


            165 GOTO 168
            167 IF RND < .5 THEN X(B) = CINT(A(B) - 1) ELSE X(B) = CINT(A(B) + 1)
        168 NEXT IPP

        185 FOR J44 = 1 TO 9


            186 IF X(J44) > 65 THEN X(J44) = 10 + FIX(RND * 50)


            187 IF X(J44) < 1 THEN X(J44) = 1 + FIX(RND * 20)



        188 NEXT J44

        189 FOR JJ11 = 1 TO 9


            190 FOR JN = JJ11 + 1 TO 10


                191 IF X(JJ11) = X(JN) THEN 1670

            192 NEXT JN

        193 NEXT JJ11

   
        195 X(10) = ((X(1) ^ 7# + X(2) ^ 7# + X(3) ^ 7# + X(4) ^ 7# + X(5) ^ 7# + X(6) ^ 7# + X(7) ^ 7# + X(8) ^ 7# + X(9) ^ 7#)) ^ .14285714285


        211 N(7) = X(10) ^ 7# - X(1) ^ 7# - X(2) ^ 7# - X(3) ^ 7# - X(4) ^ 7# - X(5) ^ 7# - X(6) ^ 7# - X(7) ^ 7# - X(8) ^ 7# - X(9) ^ 7#


        322 PD1 = -ABS(N(7))
        1111 IF PD1 <= M THEN 1670
        1452 M = PD1
        1454 FOR KLX = 1 TO 10


            1455 A(KLX) = X(KLX)


        1459 NEXT KLX


        1557 GOTO 128
    1670 NEXT I
    1889 IF M < -9 THEN 1999

    1904 PRINT A(1), A(2), A(3), A(4)

    1905 PRINT A(5), A(6), A(7)


    1906 PRINT A(8), A(9), A(10), M, JJJJ


1999 NEXT JJJJ

This computer program was run with qb64v1000-win [12, 16]. Copied by hand from the screen, the computer program’s complete output through
JJJJ= -16892.50000021984 is shown below:

27     50      33     22
14     6     59
20     41       62       0       -16892.50000021984

Above there is no rounding by hand; it is just straight copying by hand from the screen.

The solution shown above is the same as the one presented in Weisstein [14].

On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and with qb64v1000-win [12, 16], the wall-clock time for obtaining the output through JJJJ= -16892.50000021984 was one hour and a half.

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] S. Abraham, S. Sanyal, M. Sanglikar (2013), Finding Numerical Solutions of Diophantine Equations Using Ant Colony Optimization. Applied Mathematics and Computation 219 (2013), pages 11376-11387.

[2] J. L. Brenner, Lorraine L. Foster (1982), Exponential Diophantine Equations. Pacific Journal of Mathematics, Volume 101, Number 2, 1982, Pages 263-301.

[3] Martin Gardner (1979), Mathematical Games. Scientific American, 241 (3), Page 25.

[4] Martin Gardner (1983), Diophantine Analysis and Fermat’s Last Theorem, Chapter 2 of Wheels, Life and Other Mathematical Amusements. New York, San Francisco: W. H. Freeman and Company (1983). http://www.labeee.ufsc.br/~luis/ga/Gardner.pdf

[5] L. J. Lander, T. R. Parkin (1966), Counterexample to Euler’s Conjecture on Sums of Like Powers. The Bulletin of American Mathematical Society, Vol. 72, 1966, page 1079.

[6] L. J. Lander, T. R. Parkin (1967), A Counterexample to Euler’s Sum of Powers Conjecture. Mathematics of Computation, Vol. 21, January 1967, pages 101-103.

[7] L. J. Lander, T. R. Parkin, J. L. Selfridge (1967), A Survey of Equal Sums of Like Powers. Mathematics of Computation, Vol. 21, July 1967, pages 446-459.

[8] Microsoft Corp., BASIC, Second Edition (May 1982), Version 1.10. Boca Raton, Florida: IBM Corp., Personal Computer, P. O. Box 1328-C, Boca Raton, Florida 33432, 1981.

[9] O. Perez, I. Amaya, R. Correa (2013), Numerical Solution of Certain Exponential and Non-linear Diophantine Systems of Equations by Using a Discrete Particles Swarm Optimization Algorithm. Applied Mathematics and Computation, Volume 225, 1 December 2013, Pages 737-746.

[10] Tito Piezas III, Euler Bricks and Quadruples. http://sites.google.com/site/tpiezas/0021

[11] W. Sierpinski, A Selection of Problems in the Theory of Numbers. New York: The McMillan Company, 1964.

[12] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY!issue70/#galleoninterview

[13] Michel Waldschmidt, Open Diophantine Problems. Moscow Mathematical Journal, Volume 4, Number 1, January-March 2004, Pages 245-305.

[14] Eric Weisstein. Diophantine Equation--7th Powers.
http://mathworld.wolfram.com/DiophantineEquation7thPowers.html

[15] Wikipedia, Euler's sum of powers conjecture. https://en.wikipedia.org/wiki/Euler%27s_sum_of_powers_conjecture

[16] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64





Sunday, October 4, 2015

Testing the Nonlinear Integer Programming Solver with Moessner and Gloden's 6.7.8 Equation

Jsun Yui Wong

The computer program listed below seeks to solve the following Moessner and Gloden's 6.7.8 (1944) Diophantine equation presented in Weisstein [14].

X(1) ^ 6 + X(2) ^ 6 + X(3) ^ 6 + X(4) ^ 6 + X(5) ^ 6 + X(6) ^ 6    =    X(7) ^ 6 + X(8) ^ 6 + X(9) ^ 6 + X(10) ^ 6 + X(11) ^ 6 + X(12) ^ 6 + X(13) ^ 6+ X(14) ^ 6+ X(15) ^ 6

The following computer program uses qb64v1000-win [12, 16].  The following line 1893, which is 1893 IF A(j97) > 31 THEN 1999, is a precaution against the possible difficulties of the compiler with large integers.

0 DEFDBL A-Z
1 DEFINT I, K, A, X

2 DIM B(99), N(99), A(2002), H(99), L(99), U(99), X(2002), D(111), P(111), PS(33), J(99), AA(99), HR(32), HHR(32), PLHS(44), LB(22), UB(22), PX(44), J44(44), PN(22), NN(22)

88 FOR JJJJ = -32000 TO 32000 STEP .1

    89 RANDOMIZE JJJJ
    90 M = -3D+30
    111 FOR J44 = 1 TO 14

        112 A(J44) = 1 + (RND * 40)

    113 NEXT J44
    128 FOR I = 1 TO 1000

        129 FOR KKQQ = 1 TO 15

            130 X(KKQQ) = A(KKQQ)
        131 NEXT KKQQ
        139 FOR IPP = 1 TO FIX(1 + RND * 3)

            140 B = 1 + FIX(RND * 14)


            150 R = (1 - RND * 2) * A(B)
            155 IF RND < .5 THEN 160 ELSE GOTO 167
            160 X(B) = (A(B) + RND ^ 3 * R)
            164 REM IF RND<.5 THEN X(B)=(A(B)-RND*10) ELSE X(B)=(A(B) +RND*10)
            165 GOTO 168
            167 IF RND < .5 THEN X(B) = CINT(A(B) - 1) ELSE X(B) = CINT(A(B) + 1)
        168 NEXT IPP

        185 FOR J44 = 1 TO 14


            186 IF X(J44) > 50 THEN X(J44) = 10 + FIX(RND * 30)



            187 IF X(J44) < 1 THEN X(J44) = 1 + FIX(RND * 10)

        188 NEXT J44

        189 FOR JJ11 = 1 TO 14


            190 FOR JN = JJ11 + 1 TO 15


                191 IF X(JJ11) = X(JN) THEN 1670

            192 NEXT JN

        193 NEXT JJ11
        194 IF ((X(1) ^ 6# + X(2) ^ 6# + X(3) ^ 6# + X(4) ^ 6# + X(5) ^ 6# + X(6) ^ 6# + X(7) ^ 6# - X(8) ^ 6# - X(9) ^ 6# - X(10) ^ 6# - X(11) ^ 6# - X(12) ^ 6# - X(13) ^ 6# - X(14) ^ 6#)) < 0 THEN 1670
        195 X(15) = ((X(1) ^ 6# + X(2) ^ 6# + X(3) ^ 6# + X(4) ^ 6# + X(5) ^ 6# + X(6) ^ 6# + X(7) ^ 6# - X(8) ^ 6# - X(9) ^ 6# - X(10) ^ 6# - X(11) ^ 6# - X(12) ^ 6# - X(13) ^ 6# - X(14) ^ 6#)) ^ .1666666666666666666666666666666##


        211 N(7) = X(15) ^ 6# - X(1) ^ 6# - X(2) ^ 6# - X(3) ^ 6# - X(4) ^ 6# - X(5) ^ 6# - X(6) ^ 6# - X(7) ^ 6# + X(8) ^ 6# + X(9) ^ 6# + X(10) ^ 6# + X(11) ^ 6# + X(12) ^ 6# + X(13) ^ 6# + X(14) ^ 6#


        322 PD1 = -ABS(N(7))
        1111 IF PD1 <= M THEN 1670
        1452 M = PD1
        1454 FOR KLX = 1 TO 15


            1455 A(KLX) = X(KLX)


        1459 NEXT KLX


        1557 GOTO 128
    1670 NEXT I
    1889 IF M < 0 THEN 1999

    1891 FOR j97 = 1 TO 15


        1893 IF A(j97) > 31 THEN 1999



    1895 NEXT j97


    1904 PRINT A(1), A(2), A(3), A(4)

    1905 PRINT A(5), A(6), A(7)


    1906 PRINT A(8), A(9), A(10), A(11)

    1907 PRINT A(12), A(13), A(14)

    1922 PRINT A(15), M, JJJJ

1999 NEXT JJJJ

This computer program was run with qb64v1000-win [12, 16]. Copied by hand from the screen, the computer program’s complete output through
JJJJ=  32000 is shown below:

15      19      29      25
1      18      4
23      26      21      27
3      8     5
10      0      -5066.100000186068

7      16      31      3
6      8      17    
13      11     27      28
15      18      14
4      0        8952.099999829867

5      10      2      24
15       7      1
18      19       13      21
17      6       8
14      0      22380.19999976965

20      26      5      30
19      27      17
23      24      2      21
25      12      10
31      0      25616.09999972256

Above there is no rounding by hand; it is just straight copying by hand from the screen.

The solutions shown above are different from the one presented Weisstein [14].

On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and with qb64v1000-win [12, 16], the wall-clock time for obtaining the output through JJJJ= 32000 was one hour and a half.

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] S. Abraham, S. Sanyal, M. Sanglikar (2013), Finding Numerical Solutions of Diophantine Equations Using Ant Colony Optimization. Applied Mathematics and Computation 219 (2013), pages 11376-11387.

[2] J. L. Brenner, Lorraine L. Foster (1982), Exponential Diophantine Equations. Pacific Journal of Mathematics, Volume 101, Number 2, 1982, Pages 263-301.

[3] Martin Gardner (1979), Mathematical Games. Scientific American, 241 (3), Page 25.

[4] Martin Gardner (1983), Diophantine Analysis and Fermat’s Last Theorem, Chapter 2 of Wheels, Life and Other Mathematical Amusements. New York, San Francisco: W. H. Freeman and Company (1983). http://www.labeee.ufsc.br/~luis/ga/Gardner.pdf

[5] L. J. Lander, T. R. Parkin (1966), Counterexample to Euler’s Conjecture on Sums of Like Powers. The Bulletin of American Mathematical Society, Vol. 72, 1966, page 1079.

[6] L. J. Lander, T. R. Parkin (1967), A Counterexample to Euler’s Sum of Powers Conjecture. Mathematics of Computation, Vol. 21, January 1967, pages 101-103.

[7] L. J. Lander, T. R. Parkin, J. L. Selfridge (1967), A Survey of Equal Sums of Like Powers. Mathematics of Computation, Vol. 21, July 1967, pages 446-459.

[8] Microsoft Corp., BASIC, Second Edition (May 1982), Version 1.10. Boca Raton, Florida: IBM Corp., Personal Computer, P. O. Box 1328-C, Boca Raton, Florida 33432, 1981.

[9] O. Perez, I. Amaya, R. Correa (2013), Numerical Solution of Certain Exponential and Non-linear Diophantine Systems of Equations by Using a Discrete Particles Swarm Optimization Algorithm. Applied Mathematics and Computation, Volume 225, 1 December 2013, Pages 737-746.

[10] Tito Piezas III, Euler Bricks and Quadruples. http://sites.google.com/site/tpiezas/0021

[11] W. Sierpinski, A Selection of Problems in the Theory of Numbers. New York: The McMillan Company, 1964.

[12] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY!issue70/#galleoninterview

[13] Michel Waldschmidt, Open Diophantine Problems. Moscow Mathematical Journal, Volume 4, Number 1, January-March 2004, Pages 245-305.

[14] Eric Weisstein. Diophantine Equation--6th Powers.
http://mathworld.wolfram.com/DiophantineEquation6thPowers.html

[15] Wikipedia, Euler's sum of powers conjecture. https://en.wikipedia.org/wiki/Euler%27s_sum_of_powers_conjecture

[16] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64