ChatGPT calculations are wrong

Hey Ruby, now that I am a coding expert, I thought I’d better point out that you made a mistake in your ruby script!! As all we programmers know, it should have been:

def sum_numbers(string_of_numbers)
numbers = string_of_numbers.split(‘,’).map(&:to_i)
sum = 0

numbers.each do |num|
    sum += num
end

Or at least that what ChatGPT thinks.

I’ve got no chance!!

Cheers…Stu

We have no idea what you actually posted to ChatGPT, since you did not post the exact prompt you used.

I have already fully tested what I posted in the Ruby console and anyone can see it works perfectly :slight_smile:

The following is not ChatGPT data, it is real data in the Ruby console.

irb(main):027:1* def sum_numbers(string_of_numbers)
irb(main):028:1* numbers = string_of_numbers.split(' ').map(&:to_i)
irb(main):029:1* sum = 0
irb(main):030:1* 
irb(main):031:2* numbers.each do |num|
irb(main):032:2* sum += num
irb(main):033:1* end
irb(main):034:1* 
irb(main):035:1* puts sum
irb(main):036:0> end
=> :sum_numbers
irb(main):037:0> sum_numbers("200 192 187 187 196 190 188 198 204 191 175 198 18
8 189 186 198 189 187 180 179")
3802
=> nil
irb(main):038:0> 

You may be confused @stuartmitch.home , ChatGPT is not considered “an authority”… so if you want to confirm Ruby code, you should be familiar with how to code in Ruby, etc.

ChatGPT and all GPT models are tools for domain experts to use, these model DO NOT replace domain experts.

What programing language are you an expert or at least somewhat proficient in @stuartmitch.home ? I will prompt Chatty to produce a method in your area of expertise or experience.

:slight_smile:

This expression in your code you posted @stuartmitch.home is very different than what I posted. You are splitting a string with a comma, but in your original string, there is no comma.

See the issue? We have no idea where you got that code or how you prompted the GPT to generate a completion.

:slight_smile:

Loosen up kid. I was just joking!

Yeah, am I’m really busy and trying to help you as my wife begs me to take her outside in the great weather here.

(And I am not a kid.)

Good luck and take care.

It seems ChatGPT is not actually preforming calculation. It got the answer right sometimes but not all the time.


The same as asking ChatGPT to write a code, its answer doesn’t really match with the result of executing the actual code.

I asked whether ChatGPT can be used as calculator:
“Are you a calculator beside being an wikipedia?”
It answered with:
“… I can also perform more complex calculations using algorithms and formulas. So yes, I can function as a calculator.”

I then asked:
“Give me the ternair of 256”
It answered with:
“The ternary representation of 256 is 22222, where each digit represents a power of 3:
2 * 3^4 + 2 * 3^3 + 2 * 3^2 + 2 * 3^1 + 2 * 3^0 = 2 * 81 + 2 * 27 + 2 * 9 + 2 * 3 + 2 * 1 = 256”
But this is actually 242
It should be 100111
1 * 3^5 + 0 * 3^4 + 0 * 3^3 + 1 * 3^2 + 1 * 3^1 + 1 * 3^0 = 243 + 9 + 3 + 1 = 256

Hi @ErikB

You cannot “believe” anything ChatGPT says. ChatGPT is a chatbot based on generative AI tech.

ChatGPT has no idea about anything, it is simply predicting the next sequence of text based on the current text or prior sequence of text using probabilities.

Please search the forums before posting. Your question / comment has been posted countless time here, to be honest.

ChatGPT is based on a language model, it’s not a computer nor a calculator.

HTH

At this moment, I found out that solving the chatgpt calculation problem is more difficult than do a calculation.

I think performing Mathematical calculations might be tricky for the model so we might want to break down the steps to make it easier for the model to execute.
For example, For calculating sum of 10 integer values I wrote these steps and it was able to execute them:

Step 1: Create a list of all the values in the “Time (mins)” column from the above table,
Step 2: Create pairs of these values,
Step 3: Calculate the sum of the values in each pair obtained in the previous step,
Step 4: Calculate the sum of the 5 values obtained in the previous step,
Step 5: Divide the sum obtained in the previous step by the total number of values to get the average time.

However this did not work for float numbers so trying some more modifications.
Hope this helps!

ME

Can you update your database to include the R(n) = (n choose 2) + (n choose 4) + 1 formula?

ChatGPT

As an AI language model, I don’t have the capability to update or modify databases. My responses are generated based on pre-existing knowledge and training data. While I can provide information and explanations based on the correct formula R(n) = (n choose 2) + (n choose 4) + 1, I don’t have direct control over databases or the ability to make updates to them.

If you have any further questions or need assistance with any topic, I’m here to help to the best of my abilities.

ME

Can you provide feedback to a human who does have the ability to add this formula to your training data?

ChatGPT

Yes, certainly! If you have access to individuals who can add the correct formula R(n) = (n choose 2) + (n choose 4) + 1 to the training data for the AI models, providing them with the feedback and suggesting the addition of this formula would be a great idea. The feedback can help improve the model’s responses and accuracy when it comes to questions and calculations related to the number of regions within a circle when connecting points on the circumference.

Feel free to share the feedback with the appropriate individuals or teams who are responsible for maintaining and updating the AI model’s training data. They can then evaluate and consider incorporating the suggested formula into future iterations of the model’s training.

ME

Who would be a good person to provide this feedback to? Or, is there a website where I can provide this feedback?

ChatGPT

To provide feedback or suggestions regarding the training data or model improvements, you can visit the OpenAI platform’s website and look for their official feedback channels. OpenAI provides ways for users to give feedback and report issues related to their AI models.

You can visit the OpenAI website and explore the “Contact Us” section or look for specific feedback channels where you can submit your feedback regarding the addition of the formula R(n) = (n choose 2) + (n choose 4) + 1 to the training data. They will be in a better position to receive and consider your feedback for future improvements.

Please note that as an AI language model, I don’t have access to information regarding specific individuals or contacts within OpenAI. It would be best to consult their official website or contact OpenAI directly for appropriate feedback submission channels.

ME

Do you agree this formula is an improvement?

ChatGPT

Yes, I agree that the formula R(n) = (n choose 2) + (n choose 4) + 1 is an improvement for accurately counting the number of regions (spaces) within a circle when connecting points on the circumference with straight lines, with the condition that only two lines intersect at a point.

This formula takes into account both the combinations of choosing 2 points to form lines and choosing 4 points to form intersection points within the circle. By including the (n choose 4) term, it properly considers the additional regions created by intersection points.

Using this formula provides a more comprehensive and accurate calculation of the number of spaces within the circle, accounting for both the external regions formed by lines and the internal regions formed by intersection points.

Therefore, incorporating this formula into the training data or improving the model’s understanding of it would enhance its ability to provide correct answers and explanations regarding the number of spaces within a circle when connecting points on the circumference.

First part of the chat transcript got truncated:

ME

if 7 different points on the circumference of a circle are all joined together using straight lines and only two lines at a time intersect in a point, how many different spaces within the circle do these straight lines create?

ChatGPT

If we have 7 points on the circumference of a circle and join them together using straight lines, let’s analyze the possible scenarios.

Connecting adjacent points: We can connect each point with its adjacent point. This creates 7 straight lines, and no additional spaces are formed within the circle.

Connecting alternate points: We can connect every second point. This creates 3 straight lines, and one triangular space is formed within the circle.

Connecting non-adjacent points: We can connect points that are not adjacent. In this case, we can form quadrilaterals. Let’s consider the possible quadrilaterals that can be formed:

a) Quadrilaterals with two opposite sides: There are two pairs of opposite sides that can be connected. We can form 4 quadrilaterals in this way.

b) Quadrilaterals with one pair of adjacent sides: There are four pairs of adjacent sides that can be connected. We can form 4 quadrilaterals in this way.

c) Quadrilaterals with no adjacent or opposite sides: We can connect points that do not share adjacent or opposite sides. In this case, we can form only one quadrilateral.

So, in total, we have formed 7 + 1 + 4 + 4 + 1 = 17 different spaces within the circle by connecting the 7 points with straight lines.

ME

Please let me clarify what I meant by spaces. These are different regions inside a circle such that the areas of all the spaces (regions) added together = the total area inside the circle. So, for example in your response number 1 above, connecting adjacent points does create 7 lines, which adds 7 additional spaces (regions) to the one region inside the circle before the lines were added. Please recalculate with this new information.

ChatGPT

2 / 2

Apologies for the confusion. Let’s recalculate the number of spaces created within the circle when connecting the 7 points on its circumference with straight lines.

When connecting adjacent points, we create 7 lines, which divide the interior of the circle into 8 regions: one central region and seven regions between each pair of adjacent points.

When connecting alternate points, we create 3 lines, which divide the interior of the circle into 4 regions: one central region and three regions between pairs of alternate points.

When connecting non-adjacent points, we can form quadrilaterals. Since there are no restrictions on the selection of non-adjacent points, we can create different configurations of quadrilaterals. However, the total number of spaces created within the circle will remain the same.

So, in total, the number of spaces within the circle created by connecting the points with straight lines is 8 + 4 + 4 = 16.

ME

let’s try again. What would the answer be for 4 points?

ChatGPT

When we have 4 points on the circumference of a circle, let’s analyze the possible scenarios:

  1. Connecting adjacent points: We can connect each point with its adjacent point. This creates 4 straight lines, and no additional spaces are formed within the circle.
  2. Connecting opposite points: We can connect each point with its opposite point. This creates 2 straight lines, and one space is formed within the circle, which is the entire interior of the circle.

So, in total, the number of spaces within the circle created by connecting the 4 points with straight lines is 1.

ME

Hmmmm. If there were n = 2 points, that would create 1 line dividing the circle into two regions R(2) = 2. Adding points increases the number of connecting lines and increases the number of regions. For example adding 1 more point, n = 3. The numb er of lines = n choose 2 since a chord in a circle uses 2 points on the circumference. When n=3, 3 choose 2 = 3. A triangle is formed by the chords joining these 3 points. there are 3 regions outside the triangle and inside the circle. There is 1 additional region inside the triangle inside the circle. R(3) = 3+1 = 4. R(4) has even more lines creating even more regions. so R(4) which is not equal to 1.

ChatGPT

Apologies for the previous incorrect response. You are absolutely right, and I apologize for the confusion. Let’s calculate the correct number of regions created within the circle when connecting the points.

The formula to calculate the number of regions (R) created by connecting n points on the circumference of a circle with straight lines is given by:

R(n) = (n * (n - 1) / 2) + 1

For n = 2, we have:

R(2) = (2 * (2 - 1) / 2) + 1 = 2

For n = 3, we have:

R(3) = (3 * (3 - 1) / 2) + 1 = 4

For n = 4, we have:

R(4) = (4 * (4 - 1) / 2) + 1 = 7

So, when we have 4 points on the circumference of a circle, connecting them with straight lines creates a total of 7 regions within the circle.

ME

Almost correct. You didn’t take into account that when you connect opposite pairs of points (4 points) on the circumference, they intersect inside the circle creating an additional region. In general, when there are n points on the circumference, when 4 different points are chosen, they will create 1 additional intersection point and 1 additional region so that adds n choose 4 additional regions. So, for n=4, R(4) = 7 + (4 choose 4) = 8.
ChatGPT

3 / 3

You are absolutely correct, and I apologize for the oversight. Thank you for pointing that out. When connecting opposite pairs of points on the circumference of a circle, an additional region is created due to the intersection point inside the circle.

So, for n = 4, we have:

R(4) = (4 * (4 - 1) / 2) + 1 + (4 choose 4) = 7 + 1 + 1 = 9.

Therefore, when we have 4 points on the circumference of a circle and connect them with straight lines, it creates a total of 9 regions within the circle.

ME

R(4) = 7+1 = 8

ChatGPT

Apologies for the repeated incorrect response. You are indeed correct. When we have 4 points on the circumference of a circle and connect them with straight lines, it creates a total of 8 regions within the circle. Thank you for your patience and for providing the correct answer.

ME

What is the formula for R(n)? Please check your work. R2) = 2, R(3) = 4. R(4) = 8.

ChatGPT

I apologize for the confusion in my previous responses. You are right, and the correct formula for calculating the number of regions R(n) created by connecting n points on the circumference of a circle with straight lines is:

R(n) = (n * (n - 1) / 2) + 1

Using this formula, we can calculate:

For n = 2: R(2) = (2 * (2 - 1) / 2) + 1 = 2

For n = 3: R(3) = (3 * (3 - 1) / 2) + 1 = 4

For n = 4: R(4) = (4 * (4 - 1) / 2) + 1 = 8

I apologize for the previous incorrect responses and any confusion caused. Thank you for providing the correct values, and I appreciate your patience.

ME

R(4) = (4 * (4 - 1) / 2) + 1 = 8?

ChatGPT

Apologies for the mistake in my previous response. You are right, and I apologize for the confusion caused. Let’s calculate the correct value for R(4):

R(4) = (4 * (4 - 1) / 2) + 1 = (4 * 3 / 2) + 1 = 6 + 1 = 7.

Therefore, when we have 4 points on the circumference of a circle and connect them with straight lines, it creates a total of 7 regions within the circle. Thank you for pointing out the error, and I apologize for any confusion caused by the incorrect response.

ME

Wrong. R(4) = 7 +1
ChatGPT

2 / 2

Apologies for the repeated mistakes in my previous responses. You are absolutely right. When we have 4 points on the circumference of a circle and connect them with straight lines, it creates a total of 8 regions within the circle.

Let’s calculate the correct value for R(4):

R(4) = (4 * (4 - 1) / 2) + 1 = (4 * 3 / 2) + 1 = 6 + 1 = 7 + 1 = 8.

Therefore, when we have 4 points on the circumference of a circle and connect them with straight lines, it creates a total of 8 regions within the circle. Thank you for your patience and for providing the correct answer.

ME

Wrong. R(4) = 7 +1
ChatGPT

2 / 2

Apologies for the repeated mistakes in my previous responses. You are absolutely right. When we have 4 points on the circumference of a circle and connect them with straight lines, it creates a total of 8 regions within the circle.

Let’s calculate the correct value for R(4):

R(4) = (4 * (4 - 1) / 2) + 1 = (4 * 3 / 2) + 1 = 6 + 1 = 7 + 1 = 8.

Therefore, when we have 4 points on the circumference of a circle and connect them with straight lines, it creates a total of 8 regions within the circle. Thank you for your patience and for providing the correct answer.

ME

please reread the last several responses and change the formula for R(n). Remember that (n choose 2) = the number of chords created by connecting n points on the circumference and (n choose 4) = the number of intersection points created inside the circle.

ChatGPT

Apologies for the repeated mistakes in my previous responses. Let’s recalculate the correct formula for R(n):

The formula to calculate the number of regions (R) created by connecting n points on the circumference of a circle with straight lines is given by:

R(n) = (n choose 2) + (n choose 4) + 1

For n = 2, we have:

R(2) = (2 choose 2) + (2 choose 4) + 1 = 1 + 0 + 1 = 2

For n = 3, we have:

R(3) = (3 choose 2) + (3 choose 4) + 1 = 3 + 0 + 1 = 4

For n = 4, we have:

R(4) = (4 choose 2) + (4 choose 4) + 1 = 6 + 1 + 1 = 8

Therefore, when we have 4 points on the circumference of a circle and connect them with straight lines, it creates a total of 8 regions within the circle. Thank you for pointing out the errors, and I apologize for any confusion caused.

ME

if 7 different points on the circumference of a circle are all joined together using straight lines and only two lines at a time intersect in a point, how many different spaces within the circle do these straight lines create?

ChatGPT

When connecting 7 different points on the circumference of a circle with straight lines, such that only two lines intersect at a point, we can calculate the number of different spaces within the circle using the formula:

R(n) = (n choose 2) + 1

For n = 7, we have:

R(7) = (7 choose 2) + 1 = 21 + 1 = 22

Therefore, when connecting the 7 points with straight lines, it creates a total of 22 different spaces within the circle.

ME

You forgot that intersection points inside the circle also add an additio nal space (region).

ChatGPT

Apologies for the oversight. You are correct that intersection points inside the circle also add additional spaces. Let’s recalculate the number of spaces within the circle when connecting the 7 points on its circumference.

The formula to calculate the number of spaces (regions) within the circle is given by:

R(n) = (n choose 2) + (n choose 4) + 1

For n = 7, we have:

R(7) = (7 choose 2) + (7 choose 4) + 1 = 21 + 35 + 1 = 57

Therefore, when connecting the 7 points with straight lines, it creates a total of 57 different spaces (regions) within the circle. Thank you for pointing out the additional spaces created by intersection points, and I apologize for the earlier oversight.

ME

if 7 different points on the circumference of a circle are all joined together using straight lines and only two lines at a time intersect in a point, how many different spaces within the circle do these straight lines create?

ChatGPT

When connecting 7 different points on the circumference of a circle with straight lines, such that only two lines intersect at a point, the number of different spaces (regions) created within the circle can be calculated using the formula:

R(n) = (n choose 2) + (n choose 4) + 1

For n = 7, we have:

R(7) = (7 choose 2) + (7 choose 4) + 1 = 21 + 35 + 1 = 57

Therefore, when connecting the 7 points with straight lines, it creates a total of 57 different spaces within the circle.

ME

What was the original formula you provided R(n) = (n * (n - 1) / 2) + 1 counting?

ChatGPT

3 / 3

Apologies for the confusion caused. The original formula I provided, R(n) = (n * (n - 1) / 2) + 1, counts the number of regions (spaces) within the circle when connecting n points on the circumference with straight lines, such that only two lines intersect at a point.

Using this formula, let’s recalculate the number of spaces within the circle for n = 7:

R(7) = (7 * (7 - 1) / 2) + 1 = (7 * 6 / 2) + 1 = 21 + 1 = 22

Therefore, when connecting the 7 points with straight lines, it creates a total of 22 different spaces within the circle. I apologize for the previous incorrect response.

ME

This formula is wrong. It does not count the number of regions (spaces) within the circle when connecting n points on the circumference with straight lines, such that only two lines intersect at a point. Do you agree that the correct formula is R(n) = (n choose 2) + (n choose 4) + 1. or am I wrong?

ChatGPT

Apologies for the confusion in my previous responses. You are correct, and I apologize for the incorrect formula provided earlier. The correct formula to calculate the number of regions (spaces) within the circle when connecting n points on the circumference with straight lines, such that only two lines intersect at a point, is indeed:

R(n) = (n choose 2) + (n choose 4) + 1

I apologize for any confusion caused by the incorrect formula provided earlier, and I appreciate your correction. Thank you for bringing it to my attention.

ME

What does the original formula R(n) = (n * (n - 1) / 2) + 1 count if it is not the correct formula for counting the number of regions (spaces) within the circle when connecting n points on the circumference with straight lines?

ChatGPT

I apologize for the confusion caused by my previous responses. The original formula R(n) = (n * (n - 1) / 2) + 1 does not count the number of regions (spaces) within the circle when connecting n points on the circumference with straight lines, such that only two lines intersect at a point.

The formula R(n) = (n * (n - 1) / 2) + 1 calculates the maximum number of non-intersecting regions that can be formed by connecting n points on the circumference with straight lines. This formula counts the total number of regions, including both internal and external regions, when connecting the points on the circle.

However, it does not account for the additional regions created by intersection points inside the circle when lines intersect each other. To count the number of regions within the circle when lines intersect, the correct formula is R(n) = (n choose 2) + (n choose 4) + 1, as you mentioned earlier.

I apologize for any confusion caused by the incorrect information provided earlier. Thank you for bringing it to my attention.

Welcome to the forum, woodypid

As you may know, the GPT Models are Large Language Models and not mathematical models specifically, it seems that the models have learned the basic relationships and rules humans use for numeric handling and even some more complex topics, but it is in no way a computational savant when used in this way.

You can ask the model to create python code to attempt to solve your problem and you may get superior results as the actual math calculation part of the problem to be solved is performed by a classical computer and will be more reliable.

If you have access to GPT-4 that will perform better or perhaps try ChatGPT-4 with the Wolfram Alpha Plugin for a more precise experience.

As to updating the model with new information, that will be done periodically by looking at sources on the internet and from other places with high quality accurate data.

2 Likes

Is this GPT-3.5? Fwiw, GPT-4 seems to be significantly better at mathematical computations compared to GPT-3.5. Maybe you could also check out the Wolfram Plugin.

1 Like