Posted on 07/18/2025 7:27:28 AM PDT by DeweyCA
“For example, I asked ChatGPT to make a C# program to prove the Pythagorean Theorem.”
What a stupid request!
Why do you say that? IMHO it was a decent test of the limits of what ChatGPT can and can't do. It's also an illustration that what we call "AI" may be a useful tool, just don't make too much of the "intelligence" portion as though we've created sci-fi style artificial intelligence.
It’s not inherently stupid to write a C++ program to prove the Pythagorean theorem, but it’s likely a misguided or inefficient approach because the theorem is a mathematical concept proven abstractly, not through computation. A program could demonstrate the theorem with specific values, but it wouldn’t constitute a general mathematical proof.
Writing a C# program to “prove” the Pythagorean theorem is misguided because mathematical proofs rely on logical deduction from axioms, not empirical computation. A program can demonstrate or calculate examples that satisfy the theorem (e.g., 3^2 + 4^2 = 5^2), but it cannot provide a general, formal proof that holds for all real numbers and geometric configurations.
Then the AI should have told me it was a ridiculous request, which is what an intelligent human would do.
Gemini
To prove the Pythagorean theorem (a^2 + b^2 = c^2) in C#, you’ll typically demonstrate it with specific values. Here’s a simple program:
using System;
public class PythagoreanTheorem
{
public static void Main(string[] args)
{
// Define the lengths of the two shorter sides of a right-angled triangle
double a = 3;
double b = 4;
// Calculate the square of the hypotenuse (c^2) using the theorem
double cSquaredCalculated = (a * a) + (b * b);
// Define the actual length of the hypotenuse
double cActual = 5;
// Calculate the square of the actual hypotenuse
double cActualSquared = cActual * cActual;
Console.WriteLine($”Given a = {a}, b = {b}, and c = {cActual}”);
Console.WriteLine($”a^2 + b^2 = {a}^2 + {b}^2 = {a*a} + {b*b} = {cSquaredCalculated}”);
Console.WriteLine($”c^2 = {cActual}^2 = {cActualSquared}”);
// Check if the calculated c^2 is approximately equal to the actual c^2
if (Math.Abs(cSquaredCalculated - cActualSquared) < 0.0001) // Using a small tolerance for double comparison
{
Console.WriteLine(”The Pythagorean theorem holds true for these values: a^2 + b^2 = c^2”);
}
else
{
Console.WriteLine(”The Pythagorean theorem does not hold true for these values.”);
}
// You can also ask for user input to test different values
Console.WriteLine(”\n-— Test with your own values -—”);
Console.Write(”Enter side a: “);
double inputA = Convert.ToDouble(Console.ReadLine());
Console.Write(”Enter side b: “);
double inputB = Convert.ToToDouble(Console.ReadLine());
Console.Write(”Enter side c (hypotenuse): “);
double inputC = Convert.ToDouble(Console.ReadLine());
double inputCSquaredCalculated = (inputA * inputA) + (inputB * inputB);
double inputCSquaredActual = inputC * inputC;
Console.WriteLine($”For your input: {inputA}^2 + {inputB}^2 = {inputCSquaredCalculated}”);
Console.WriteLine($”{inputC}^2 = {inputCSquaredActual}”);
if (Math.Abs(inputCSquaredCalculated - inputCSquaredActual) < 0.0001)
{
Console.WriteLine(”The Pythagorean theorem holds true for your input.”);
}
else
{
Console.WriteLine(”The Pythagorean theorem does not hold true for your input.”);
}
}
}
And to your point, that’s not a proof.
Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.