The end...

Discussion in 'Computer Science & Culture' started by Waiter_2001, Oct 13, 2014.

  1. Waiter_2001 Registered Senior Member

    Messages:
    459
    I thought I would post a conclusion to a recently posted formula. The following attempts to discover the formula for division by zero (which when known can be discovered manually):

    Code:
    DIM C(9)
    
    A=1
    
    FOR B=1 to 9
    
    C=A/B
    
    NEXT B
    
    FOR D=1 TO 9
    
    FOR E=0 TO 9
    
    FOR F=1 TO 9
    
    FOR G=0 TO 9
    
    FOR H=1 TO 9
    
    I=(((A+B)*C)-D)/E
    
    IF (I=C(D)) THEN
    
    J=0
    
    FOR K=1 TO 9
    
    L=(((K+E)*F)-G)/H
    
    IF (L=C(K)) THEN J=J+1
    
    IF (J=9) THEN
    
    PRINT E;":";F;":";G;":";H
    
    END
    
    END IF
    
    NEXT K
    
    END IF
    
    NEXT H
    
    NEXT G
    
    NEXT F
    
    NEXT E
    
    NEXT D
    You may have to include "C" as a string (C$) and therefore "C$=STR$(A/B)."

    However the code is "unsuccessful" at finding a solution. You may also adjust A to equal 1-9 but again it is "unsuccessful." I include quotes around the word "unsuccessful" because while a solution is not discovered, even with EVERYTHING (such as the program uses) it can reach the end!

    Please Register or Log in to view the hidden image!

     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Waiter_2001 Registered Senior Member

    Messages:
    459
    You may also use the following:

    Code:
    FOR A=1 TO 24
    
    B(1)=A+B*C-D/E
    ...
    [EVERY COMBINATION OF OPERATORS]
    ...
    B(2)=A/B+C*D-E
    ...
    C=B(A)
    
    NEXT A
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. leopold Valued Senior Member

    Messages:
    17,455
    the above program will not run as written.
    the B loop will execute.
    the d,e,f,g,h loops will initialize but the program will terminate when you try to assign I a value because of a division by zero.
     
  6. Google AdSense Guest Advertisement



    to hide all adverts.

Share This Page