一道大模型解不出来的数学题

AMC8数学竞赛中有这样一道数学题:

翻译成中文:9876543210十个数字重复20遍,组成200位数字的数字串。接下来,按如下方法对数字串进行处理:按1、2、3循环报数,数到3的数字出列;对出列后组成的新数字串继续报数,数到3的继续出列。一直进行下去,直到数字串最后剩下2位。请问最后两位数字是什么?  

这道题目本身不难。可以用数学演算、大模型问答、编程等多种解法。

首先我们可以用传统的数学演算方法求解。

第1遍挑选

  • 原字符串:9876543210 9876543210 9876543210 9876543210 9876543210 9876543210 ...共20组
  • 每3位数字挑选1位:200/3=66,第一遍可以选出66位数字,它们是:741 852 9630 ... 共6组,并附带6位后缀741852
  • 第1遍的结果如下:7418529630 7418529630 7418529630 7418529630 7418529630 7418529630 741852

第2遍挑选

对上1遍的结果,继续每3位数字挑选1位(第三位),结果如下:

  • 1234567890 1234567890 12

第3遍挑选

  • 继续每3位数字挑选1位(第三位),结果为3692581

第4遍挑选

  • 98,这就是最后结果

第二种方法是直接问AI大模型求解。先用GPT-4o

To solve this problem, let's break down the process: Start with the 200-digit number, which consists of the digits 987654321098765...543210 repeated. From this 200-digit number, choose every third digit, starting from the left. This creates a new number. Repeat the process with the new number by again selecting every third digit until you are left with a two-digit number. Step-by-step Process: The original number is made by repeating the digits 987654321098765...543210987654321098765...543210 multiple times, so the digits repeat in a pattern. Select every third digit from the first number. Let’s illustrate the first few steps: The digits chosen from the first number would be: 9,6,3,0,9,6,3,0,…9, 6, 3, 0, 9, 6, 3, 0, \dots (since you select every third digit starting from the left). After the first step, this creates a new number based on the sequence formed by these digits. Continue repeating the process with the new number, and each time, you will pick every third digit. Eventually, this will reduce to a two-digit number. Given the pattern of selection, the resulting two-digit number after applying the process multiple times is 69. Thus, the answer is 69\boxed{69}.

结果居然是错的!错误开始在步骤9(上图斜体字所在的段落),从左开始,每3个数字选择第三个数字组成的新数字串已经不对了。

将这道题目直接扔给豆包或者DeepSeek,AI给出的结果都是错误的。DeepSeek甚至一直在转圈,陷入了思考死循环。下面是DeepSeek的截图。

如何用大模型求解这类较复杂的数学题目?正确的做法是分解问题,分步骤询问大模型。特别是对这种需要迭代才能求解的数学问题,可以不直接问结果,而是让大模型给出Python代码。比如将问题描述做如下改造,然后问豆包:

Generate the 200-digit number 987654321098765 ...543210 which repeats the digits 0-9 in reverse order. From the left, choose every third digit (indices are 2, 5,8 etc., as the index starting from 0) to form a new number. Repeat the same process with the new number. Continue the process repeatedly until the result is a two-digit number. What is the resulting two-digit number? Please solve the problem with Python codes.

豆包给出的Python代码和解释如下:

# Generate the 200 - digit number
base_pattern = '9876543210'
number_str = base_pattern * (200 // len(base_pattern))

while len(number_str) > 2:
    # Select every third digit
    new_number_str = number_str[2::3]
    number_str = new_number_str

result = int(number_str)
print(result)

以上是豆包给出的可以直接运行的Python代码。

Explanation: Generate the 200 - digit number: First, we define the base pattern '9876543210'. Then we repeat this pattern enough times to get a 200 - digit number by using string multiplication. The number of times we need to repeat the pattern is 200 // len(base_pattern) (integer division). Iterative process: We use a while loop to keep processing the number as long as its length is greater than 2. Inside the loop, we create a new number string by selecting every third digit of the current number string using slicing. The slicing notation [2::3] means start at index 2 and take every third element. After that, we update the number_str with the newly created string. Result: Once the length of number_str becomes 2, we convert it to an integer and print the result. This is the two - digit number we are looking for.

豆包给出的解释非常清楚:

解释: 生成 200 位数字: 首先,我们定义基础模式 “9876543210”。 然后,我们通过字符串乘法重复此模式足够多次以获得 200 位数字。需要重复模式的次数是 200 //len (base_pattern)(整数除法)。 迭代过程: 只要数字的长度大于 2,我们就使用一个 while 循环持续处理该数字。 在循环内部,我们使用切片通过选取当前数字字符串的每第三个数字来创建一个新的数字字符串。切片符号 [2::3] 表示从索引 2 开始,每隔三个元素取一个。 之后,我们用新创建的字符串更新 number_str 。 结果: 一旦 number_str 的长度变为 2,我们将其转换为整数并打印结果。这就是我们要找的两位数。

运行豆包给出的Python代码,给出的结果如下:

现在国内国外的大模型能力越来越强大了,特别是其数学求解和编程能力,已经远超一般人的水平。但如何正确使用大模型,保证大模型给出的答案更准确、更有质量,仍需要使用者学会分解问题、保证自己问的问题清晰、准确、没有歧义。另外,不要满足于大模型直接给出答案,而是要看懂大模型给出的求解问题的步骤。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值