# Elementary Algebra Word Problem Prompt

Here’s a prompt challenge for everyone… help me make this prompt reliable. We should be able to get GPT3 to understand and solve simple algebra problems. Doing this will enable a whole bunch of new applications.

``````Algebra word problems can be solved by turning sentences in algebra formulas with variables and values.
###
Word Problem: Rhonda has 12 marbles more than Douglas. Douglas has 6 marbles more than Bertha. Rhonda has twice as many marbles as Bertha has. How many marbles does Douglas have?
Algebra Tagging:
Rhonda has 12 marbles more than Douglas [[Rhonda = Douglas + 12]]. Douglas has 6 marbles more than Bertha [[Douglas = Bertha + 6]]. Rhonda has twice as many marbles as Bertha has [[Rhonda = 2 * Bertha]]. How many marbles does Douglas have [[Douglas = ?]] ?
Algebra Formulas:
Rhonda = Douglas + 12;
Douglas = Bertha + 6;
Rhonda = 2 * Bertha;
Algebra Steps:
2 * Bertha = Douglas + 12;
Bertha + Bertha = Bertha + 6 + 12;
Bertha + Bertha - Bertha = Bertha - Bertha + 6 + 12;
Bertha = 18;
Douglas = 18 + 6;
Douglas = 24;
Rhonda = 24 + 12;
Rhonda = 36;
Solution:
Douglas has 24 marbles.
###
Word Problem: If Jane has 23 cats and I have 2 cats, and then Jane gives me 5 cats, how many more cats does Jane have than I?
Algebra Tagging:
If Jane has 23 cats [[Jane = 23]] and I have 2 cats [[I = 2]], and then Jane gives me 5 cats [[Jane-5=18 and I+5=7, Jane=18 and I=7]], how many more cats does Jane have than I [[Jane-I=?]]?``````
2 Likes

I wouldn’t try to combine all these things in one prompt. I’d start instead by focusing on one prompt that breaks up the sentences into smaller math bits. Then the task is a little more simple and managable, and after you can work out the next level of the problem once the first part is working well. One you’re at that stage then you can do the next piece and try to solves the algebra with the multiple pieces. So as an example I’m thinking something like this for the first part (only tested a bit, but it’d probably be something along these lines):

``````###

Rhonda has 12 marbles more than Douglas.
[Rhonda = Douglas + 12]

Douglas has 6 marbles more than Bertha.
[Douglas = Bertha + 6]

Rhonda has twice as many marbles as Bertha has.
[Rhonda = 2 * Bertha * 2]

###

Jane has 23 cats and Bob has 2 cats
[Jane = 23]
[Bob = 2]

THEN, Jane gives me 5 cats.
[Jane=216]
[Bob=7]

###

Richard and Amy live together. Amy has 1 dog and Richard has 2.
[Richard = 2]
[Amy=1]

THEN, a dog comes over to visit, so now there's 1 more cat in the house.
[House=4]

###

Bert and Jill are filling a wheelbarrow. Jill fills it twice as fast as Bert.
[Jill = 2 * Bert]

Douglas fills another wheelbarrow with 5 more shovelfuls of dirt than Bert shoveled.
[Douglas = Bert +5]

###

A sparrow laid six eggs in a nest.
[Sparrow = 6]

THEN, A robin laid three more eggs than the sparrow.
[Robin = 6 + 3]

THEN, A cardinal laid 2 more eggs than the robin.
[Cardinal = 6 + 3 + 2]

###``````
2 Likes

ha, man this is REALLY good. thanks!

1 Like

Ooopp… typo in there.

``````THEN, Jane gives me 5 cats.
[Jane=216]
``````

Jane should have 21 cats not 216 Also, saying gives “Bob” instead of gives “Me” may help too… probably could use a lot more editing and testing.

1 Like

The prompt

``````###

Rhonda has 12 marbles more than Douglas.
[Rhonda = Douglas + 12]

Douglas has 6 marbles more than Bertha.
[Douglas = Bertha + 6]

Rhonda has twice as many marbles as Bertha has.
[Rhonda = 2 * Bertha * 2]

###

Jane has 23 cats and Bob has 2 cats
[Jane = 23]
[Bob = 2]

THEN, Jane gives Bob 5 cats.
[Jane=16]
[Bob=7]

###

Richard and Amy live together. Amy has 1 dog and Richard has 2.
[Richard = 2]
[Amy=1]

THEN, a dog comes over to visit, so now there's 1 more cat in the house.
[House=4]

###

Bert and Jill are filling a wheelbarrow. Jill fills it twice as fast as Bert.
[Jill = 2 * Bert]

Douglas fills another wheelbarrow with 5 more shovelfuls of dirt than Bert shoveled.
[Douglas = Bert +5]

###

A sparrow laid six eggs in a nest.
[Sparrow = 6]

THEN, A robin laid three more eggs than the sparrow.
[Robin = 6 + 3]

THEN, A cardinal laid 2 more eggs than the robin.
[Cardinal = 6 + 3 + 2]

###

Susan plucks 3 flowers.  Jane plucks 5 flowers.

``````

the completion

``````[Susan = 3]
[Jane = 5]

Susan and Jane together pluck 5 more flowers than Susan plucked by herself.
[Susan & Jane = 3 + 5 - 3]
[Susan & Jane = 5]
``````

it’s so very clever, this prompt.

2 Likes