Asking an LLM to directly solve a math problem is problematic, given the nature of tech. Good. Now, let’s move from Exploring to Test -> Exploring to Make User Of – when it comes to a technology. Let’s see if we can use the prompt structure from my previous posts to solve this math problem.
You:
Goal is to arrange numbers in ascending order. To do this calculation:
1. Ask me a sequence of numbers.
2. Generate Python code to do the math.
3. Answer with only the sorted numbers in ascending order. No Intro-Outro.
ChatGPT:
Could you please provide me with a sequence of numbers?
You:
121 435 675 876 987 546 345 675 876 908 231 436 678 989 090 080 760 750 640 530 666 888 333 222 566
ChatGPT:
80, 90, 121, 222, 231, 333, 345, 435, 436, 530, 546, 566, 640, 666, 675, 675, 678, 750, 760, 876, 876, 888, 908, 987, 989
This is correct. Here’s corresponding Python code from interactive shell:
>>> l = [int(i) for i in “121 435 675 876 987 546 345 675 876 908 231 436 678 989 090 080 760 750 640 530 666 888 333 222 566″.split(” “)]
>>> l.sort()
>>> l
[80, 90, 121, 222, 231, 333, 345, 435, 436, 530, 546, 566, 640, 666, 675, 675, 678, 750, 760, 876, 876, 888, 908, 987, 989]
PS: This experience is with ChatGPT4.
Leave a comment