| ||
|
A part of techInterview.org: answers to technical interview questions.
Your host: Michael Pryor |
x = 3, y = 4, z = 5 is one solution to the equation: x^2 + y^2 = z^2 Can you prove that this equation has an infinite number of solutions ? Hint: You don't need to use algebra to find the solution
This equation represents a circle at center (0, 0) and radius "z". For any value of z, a circle can be drawn which has infinite number of points, thus infinite solutions for the equation.
Take two integers m and n and consider the equation square(m-n) + 4*m*n = square(m+n). This equation is always true. So if we find m and n such that, m*n is a perfect square, then we can have x = m+n, y = 2*sqrt(m*n) and z = m-n and always satisfy square(x)+square(y)=square(z). It is obvious that we can find infinite such m and n such that m*n is a perfect square.
Look at the sequence of differences of consecutive squares: N: 1 2 3 4 5 6 n^2:1 4 9 16 25 36 diff 3 5 7 9 11 An infinite number of (odd) squares occur in the 3rd row. Where 9 occurs in the 3rd row, that corresponds to 5^2 - 4^2 = 9 = 3^2; similarly at 13^2 - 12^2 = 25, etc. Each of those infinitely many occurrences is a Pythagorean triple. | |
Powered by FogBugz
