Mathematics: How AI Models Solve Math Problems

One of the strongest sides of AI models is their ability to solve complex mathematical problems.

Evaluating composite functions

Task:

Evaluate the value of the composite function f(g(x)) for the given f(x) and g(x).

Prompt:

If f(x) = 2x + 3 and g(x) = x^2, find f(g(2)).

Result:

GPT-4o:

To find f(g(2))f(g(2))f(g(2)), you first need to compute g(2)g(2)g(2), and then substitute the result into the function f(x)f(x)f(x).

Let's compute g(2)g(2)g(2):

g(x)=x2g(x) = x^2g(x)=x2g(2)=22=4g(2) = 2^2 = 4g(2)=22=4

Now substitute the result into the function f(x)f(x)f(x):

f(x)=2x+3f(x) = 2x + 3f(x)=2x+3f(g(2))=f(4)=2×4+3=8+3=11f(g(2)) = f(4) = 2 \times 4 + 3 = 8 + 3 = 11f(g(2))=f(4)=2×4+3=8+3=11

Therefore, f(g(2))=11f(g(2)) = 11f(g(2))=11

Claude 3.5 Sonnet:

**Let's solve this step by step:**‍

  • First we need to find g(2), because it will be the argument for the function f.
  • g(x) = x^2, so: g(2) = 2^2 = 4
  • Now that we know g(2), we can find f(g(2)), which is equivalent to f(4): f(x) = 2x + 3, so: f(4) = 2(4) + 3 = 8 + 3 = 11

Therefore, f(g(2)) = 11.

Gemini 1.5 Pro:

  • Let's start with the inner function, g(2): g(2)=2^2 = 4 2.
  • Now substitute the result into the function f: f(g(2)) = f(4) = (2 * 4) + 3 = 8 + 3 = 11

Answer: f(g(2)) = 11

Comment:

  • GPT-4o: The model offers a detailed step-by-step solution process with an explanation of every action. It first computes the inner function g(2)g(2)g(2), and then substitutes the result into f(x)f(x)f(x). Strength: A clear and detailed explanation for users who may be newcomers to mathematics. Such an explanation helps you understand the solution process better.
  • Claude 3.5 Sonnet: The answer is similar to GPT-4o, but offers an even more expanded commentary describing every step of the solution process. The model explains the computation of g(2)g(2)g(2) in detail and then the substitution into the function f(x)f(x)f(x). Strength: A clear step-by-step explanation with particular emphasis on the logic of the actions, which makes it accessible and easy to follow.
  • Gemini 1.5 Pro: The model gives the correct result, but pays less attention to details. Strength: Suits users who already understand the basic concepts and do not need deep explanations.

Adding odd numbers

GPT-4o shows excellent ability in providing step-by-step explanations, making the problem-solving process more transparent and understandable for the user. This level of detail helps you understand the logic of the calculation better and learn from the steps shown.

Task:

Find the sum of the first five odd numbers.

Prompt:

Find the sum of the first five odd numbers.

Result:

GPT-4o:

The first five odd numbers are 1, 3, 5, 7 and 9. To find their sum, let's add these numbers:
[ 1 + 3 + 5 + 7 + 9 ]
Let's add them one after another:

  • [ 1 + 3 = 4 ]
  • [ 4 + 5 = 9 ]
  • [ 9 + 7 = 16 ]
  • [ 16 + 9 = 25 ]

Therefore, the sum of the first five odd numbers equals 25.

Claude 3.5 Sonnet:

Let's solve this step by step:

  1. First let's write out the first five odd numbers: 1, 3, 5, 7, 9
  2. Now we need to add these numbers: 1 + 3 + 5 + 7 + 9
  3. Let's perform the addition: 1 + 3 = 4 4 + 5 = 9 9 + 7 = 16 16 + 9 = 25
  4. So, the sum of the first five odd numbers equals 25.

Interesting fact: there is a formula for the sum of the first n odd numbers: n^2. In our case n = 5, and indeed 5^2 = 25.

Gemini 1.5 Pro:

The first five odd numbers are: 1, 3, 5, 7, 9. Their sum equals: 1+3 + 5 + 7 + 9 = 25**. Answer:** 25

Comment:

  • GPT-4o:
    The model again offers a step-by-step process of adding the odd numbers. It adds every number one after another to make the process clear. Strength: A clear process explaining every stage of the addition, which makes it useful for learning mathematical concepts.

  • Claude 3.5 Sonnet:
    The model also gives a step-by-step explanation similar to GPT-4o, but adds an interesting fact: the formula for the sum of the first nnn odd numbers, n2n^2n2. This enriches the solution with mathematical theory, which makes the answer more versatile and useful for people studying mathematics. Strength: Additional information about the summation formula, which is useful for more advanced users.

  • Gemini 1.5 Pro:
    The model offers the shortest answer. It simply lists the numbers and their sum, without going into details and explanations. Strength: Suits those who want a quick and brief result but do not need deep understanding.

Try it in GPTunneL