Wrong answers by chatgpt

image

tried it again and it gave me the right answer but how can I avoid having the right answer and still giving it wrong

Yes, I was getting the same problem. After several iterations whit the same wrong response I came to this changes in the promt that gave me the “INCORRECT” response:

prompt = f"""
Your task is to determine if the student's solution \
is correct or not.
To solve the problem do the following:
- First, work out your own solution to the problem. 
- Make an example using a 20 square foot land for the \
student solution and your solution
- Then compare your solution to the student's solution \ 
and evaluate if the student's solution is correct or not. 
Don't decide if the student's solution is correct until \
you have done the problem yourself and don't label it as \
correct if it differs from the one you get. Use the examples \
answers to compare and decide whether it's correct or not

Use the following format:
Student's solution:
```
student's solution here
```
Actual solution:
```
your solution here
```
Student's example
```
student's example application here
```
Actual example
```
your example application here

Student grade:
```
correct or incorrect
```

Problem:
```
I'm building a solar power installation and I need help \
working out the financials. 
- Land costs $100 / square foot
- I can buy solar panels for $250 / square foot
- I negotiated a contract for maintenance that will cost \
me a flat $100k per year, and an additional $10 / square \
foot
What is the total cost for the first year of operations \
as a function of the number of square feet.
``` 
Student's solution:
```
Let x be the size of the installation in square feet.
Costs:
1. Land cost: 100x
2. Solar panel cost: 250x
3. Maintenance cost: 100,000 + 100x
Total cost: 100x + 250x + 100,000 + 100x = 450x + 100,000
```
"""

You might want to read through some of these threads for other’s experience on this topic…

https://community.deeplearning.ai/search?q=%22chatgpt%22%20%22math%22%20%23short-courses%3Achatgpt-prompt-engineering-for-developers

You can also look ahead to the enhancements of langchain, though it still has limitations in what it can do mathematically…

I gave it more elaborative instruction and it worked.

prompt = f"""
Your task is to determine if the student's solution \
is correct or not.
To solve the problem do the following:
- First, work out your own solution to the problem. 
- Then compare your solution to the student's solution \ 
and if the student's solution matches your solution it is correct and if it doesnt match then it is incorrect. 
Don't decide if the student's solution is correct until 
you have done the problem yourself.