assuming that x and y represent the same nonzero number:

x=y

x^2=xy

x^2 - y^2=xy - y^2

(x+y)(x-y)=y(x-y)

x+y=y

2y=y

2=1

1=0

what just happened here?

I honestly don't know...

This is a discussion on *1=0.* within the **A Brief History of Cprogramming.com** forums, part of the Community Boards category; assuming that x and y represent the same nonzero number:
x=y
x^2=xy
x^2 - y^2=xy - y^2
(x+y)(x-y)=y(x-y)
x+y=y
2y=y
...

- 08-05-2008 #1

- Join Date
- Mar 2008
- Posts
- 11

## 1=0.

assuming that x and y represent the same nonzero number:

x=y

x^2=xy

x^2 - y^2=xy - y^2

(x+y)(x-y)=y(x-y)

x+y=y

2y=y

2=1

1=0

what just happened here?

I honestly don't know...

- 08-05-2008 #2
if x=y then x-y = 0

so in the third step you are dividing by 0

- 08-05-2008 #3

- Join Date
- Mar 2008
- Posts
- 11

oh, wow. good catch.

Thanks, man.

- 08-06-2008 #4

- Join Date
- Nov 2001
- Posts
- 1,901

My friend showed me this in high school, he was good at math so he thought he could trick us and I found it out fast. I do remember his being different, though. It still had the divide by zero thing.

Here to Deceive, Inveigle, Obfuscate Since 1945

- 08-06-2008 #5
Yeah I've seen this one enough to immediately know it is dividing by 0.

- 08-06-2008 #6

- 08-06-2008 #7
Well, you also violated a lot of conventions and rules about the seperation of equality and equivelancy.

x=y

this is a statement of equality which makes x and y dependant variables.

x^2=xy

this is a conjecture of equivelancy which only holds true for the case of x == y

x^2 - y^2=xy - y^2

this further assumes the case that x == y. If x and y are independant this statement is false.

(x+y)(x-y)=y(x-y)

You are mixing general solutions with special case solutions and presenting the special case solution as a general solution which is erroneous.

y(x-y) = xy - y^2

(x+y)(x-y) = x^2 - xy + xy -y^2 = x^2 - y^2 not xy - y^2

x+y=y

this holds true only for the case of x = 0

2y=y

this is true only for the case of y = 0

the rest is nonsense as a result of faulty logic. makign a statement which holds true only for a single case and then applying it as if it held for all cases (false generalization,).

2=1

1=0

for 0<x<9 all odd numbers are prime. TRUE

since odd numbers are prime and 9 is an odd number 9 is prime. FALSE.

that is what you are doing, assuming that because a statement (xy = y^2) holds true under restricted conditons (x = y), that it holds true without those restrictions.Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

- 08-07-2008 #8

- 08-07-2008 #9

- 08-07-2008 #10

- Join Date
- Nov 2001
- Posts
- 1,901

- 08-07-2008 #11

- 08-09-2008 #12
Well of course, why do you think that most mathematical theorems and proofs start with "Given that...", "assume that..." or "Let us define...". In a mathematical proof, it is ok to define a set of initial conditions and then proceed logically assuming these are true, so long as you say so. So the fallacy in this classic 1=2 proof, is not where you suggest.

For example, Pythagoras' theorem says something along the lines of "Given a right angled triangle, the square of the length of the hypotenuse is equal to the sum of the squares of the two remaining sides." What you appear to be arguing is that this would not be true if it was not a right angled triangle, well of course! That's why we define it to be one in the first place.

Similarly, it's perfectly ok to say that x^2 - y^2 = xy - y^2 in this case, since the first thing we did in this proof was say that x=y.

- 08-09-2008 #13
When you get to this step:

sqrt(-1)*

you choose the wrong one to preserve the equilityThe first 90% of a project takes 90% of the time,

the last 10% takes the other 90% of the time.

- 08-13-2008 #14

- 08-13-2008 #15

- Join Date
- Aug 2007
- Location
- Toronto, ON
- Posts
- 3,545

Actually, the first one is right (look at the parenthesis):

sqrt( (-1) * (-1) ) = sqrt( 1 ) = 1

The second one is where reality flies out the window since it uses the Product Rule for Radicals, but the product rule for radicals says:

The nth root of a product is equal to the product of the nth roots.**provided that all of the expressions represent real numbers.**

- Exactly how to get started with C++ (or C) today
- C Tutorial
- C++ Tutorial
- 5 ways you can learn to program faster
- The 5 Most Common Problems New Programmers Face
- How to set up a compiler
- 8 Common programming Mistakes
- What is C++11?
- Creating a game, from start to finish

- How to create a shared library on Linux with GCC - December 30, 2011
- Enum classes and nullptr in C++11 - November 27, 2011
- Learn about The Hash Table - November 20, 2011
- Rvalue References and Move Semantics in C++11 - November 13, 2011
- C and C++ for Java Programmers - November 5, 2011
- A Gentle Introduction to C++ IO Streams - October 10, 2011