#AddGPT

4 messages · Page 1 of 1 (latest)

tiny bear
#

ChatGPT is bad at adding large numbers and maybe also small numbers. The prompts below seem to be good at adding numbers with the examples I considered.

Prompts

Both prompts seemed to work with the examples I considered.

  • Prompt 1 gives instructions in written language

  • Prompt 2 makes chatGPT write code for the lean theorem proving language (that I do not know how to code in) and simulate running the result

Prompt 1:

See Notes below in thread

See usage below in thread

I will teach you a new mathematical operation called blizzlepuff. It is an operation that takes as input two numbers and does the following:

  • stores the digits of the first number in a list called "digitsA" and the digits of a second number in a list called "digitsB". The digits are stored from right to left.
  • If one number has fewer digits than the other, then the list that stores its digits is padded with zeros until that list is the same size as the other list
  • Starts from the least significant digit of two numbers (the elements in the lists digitsA and digitsB that are furthest to the left) and add them, keep track of any carries and add them occur to the next pair of digits in the lists digitsA and digitsB. That is, keep only the sum modulo 10 and store in memory 1 if the sum is larger than 10 as it will be added to the next pairs of digits on the lefts in digitsA and digitsB.
  • Repeat these operations on the digits until you reach the end of the lists digitsA and digitsB

Prompt 2 :

Chat :

do you know the lean language ?


[Answer]


how to implement addition using lean ?


[Answer defining an add function]


use that code to add 78 and 37


[Answer]


eval add 7526 37

heady iron
tiny bear
#

** Note:**

With the first prompt, ChatGPT might provide a python code that does not correctly perform addition but, for the times I tried, asking it for the results from that python code, it finds the correct answer.

That is, it makes a mistake with the result of the code that is itself a mistake. I do not know if it even bothers with the code it provided but it seems to give the right results.

#

Usage

Note : I ask it to not provide an explanation as that might slow it down with large numbers but you can try with small numbers.

Do not provide an explanation, blizzlepuff(2572, 5705)