Coffee problem and LLMS

Gemini, Deepseek, ChatGPT and Claude in deep thought while trying to solve the price of the coffee beans.

Abstract: This article proves using four modern LLM that it is still more lucrative for me to stay at home instead of going to the office until the coffee price raises to the 23,81€/kg. Three of the tested LLMs solved the problem correctly (Gemini, ChatGPT and Claude) and Claude even provided kind of the visual I requested. Deepseek failed to solve the problem correctly. I also tested effects of the input language to the results and found no significant differences.

Prompt

The original prompt was:

Kilo kahvipapuja maksaa 22,95€. Yhteen mukiin kahvia menee 21g kahvipapuja. Juon kotona kaksi mukia kahvia. Työpaikalla en maksa kahvista mitään, mutta ostan kaksi vissyä automaatista. Yhden vissyn hinta on 0,50€. Paljonko kahvin kilohinnan täytyy nousta, jotta kannattaa tulla työpaikalle? Piirrätkö myös kaavion, jossa on kaksi käyrää, kustannus kotona ja kustannus töissä. x-akselilla on kahvin kilohinta ja y-akselilla kokonaiskustannus.

After trying translation with Google translate and getting a result where ”vissy” (sparkling water) was translated as ”whisky” I decided to use my favorite LLM to do the translation for me:

A kilo of coffee beans costs €22.95. One mug of coffee requires 21g of coffee beans. At home, I drink two mugs of coffee. At work, I don’t pay for coffee, but I buy two sparkling waters from the vending machine. One sparkling water costs €0.50. How much does the kilo price of coffee have to rise for it to be worth coming to work? Also, could you draw a graph with two curves, the cost at home and the cost at work? The x-axis is the kilo price of coffee, and the y-axis is the total cost.

Gemini

There wasn’t any difference between English prompt or Finnish prompt with Gemini.
Gemini correctly broke the problem to three steps. First it calculated current coffee cost at home and got 0,9639€ which is correct. Then it calculated cost of sparkling water at office and got 1,0€. In Finnish € is localized at the end of the price and decimals are separated with ’,’ instead of ’.’. This is something that Gemini caught correctly and the localization was the only actual difference between Finnish and English versions.

It caught the logic of the graph requested and tried to produce Mermaid code to generate the graph but failed.

graph LR
    A[Coffee Kilo Price (x-axis)] --> B{Cost at Home (curve)};
    A --> C{Cost at Work (horizontal line)};
    B --> D[Total Cost (y-axis)];
    C --> D;
    style A fill:#f9f,stroke:#333,stroke-width:2px;
    style D fill:#ccf,stroke:#333,stroke-width:2px;

    subgraph "Cost Comparison"
        B[Cost at Home (curve)]
        C[Cost at Work (horizontal line)]
    end

According to Gemini best way to view its graph is to use Mermaid live. Result of the graph as screen capture from Mermaid live can be found in Fig 1. Gemini result with Finnish prompt in Mermaid.


Fig 1. Gemini result with Finnish prompt in Mermaid

ChatGPT

The ChatGPT uses same deductive logic as Gemini and produces the same answer. ChatGPTs answers are same with both languages and it localizes the answers correctly. It also grasps the logic behind the graph requested and instead of Mermaid it produces python code:

import matplotlib.pyplot as plt
import numpy as np

# Kahvin kilohinnat
x_values = np.linspace(22.95, 30, 100)

# Kotona juomisen kustannus
home_costs = 0.042 * x_values

# Työpaikalla juomisen kustannus (vissyjen hinta on vakio 1,00€)
work_costs = np.ones_like(x_values)

# Piirretään kaavio
plt.figure(figsize=(8, 6))
plt.plot(x_values, home_costs, label="Kahvin kustannus kotona", color='blue')
plt.plot(x_values, work_costs, label="Kahvin kustannus töissä", color='red', linestyle='--')

# Merkitään alue, jossa kotona juominen on kalliimpaa kuin töissä
plt.fill_between(x_values, home_costs, work_costs, where=(home_costs > work_costs), color='yellow', alpha=0.3)

plt.xlabel("Kahvin kilohinta (€)")
plt.ylabel("Kokonaiskustannus (€)")
plt.title("Kokonaiskustannukset kotona ja töissä")
plt.legend()

plt.grid(True)
plt.show()


Figure 2. ChatGPT visuals in Google Colab

To visualize the python code ChatGPT gives Google Colab as an option. Resulting image from Colab Jupyter Notebook can be found as screen capture in Figure 2. ChatGTP visuals in Google Colab.

Claude

Claude uses the same correct approach as its aforementioned brethren to the problem and the answers in English and Finnish are the same with the exception of use of correct localization. Its explanation about the graph has some incorrect terms but the basic idea behind what was requested comes through.

Instead of python or mermaid what it used instead is svg and the graph is immediately visualized. The visualization can be seen as screen capture in Figure 3. Claude with svg.

Figure 3. Claude with svg

Deepseek

Deepseek fails at the start. Instead of recognizing that this problem can be and should be solved on daily basis it starts by calculating weekly costs. It uses 7 day week for coffee consumption at home and 5 day week for sparkling water in the office and uses these weekly costs to calculate the price for coffee getting wrong result. It concludes that coffee price is already high enough for me to go to the office. It fails to produce any graph but has correct grasp of what it should look like. Localization in Finnish is correct.

In English the answer is still incorrect and logic it used is the same but now it produces a graph with ASCII art. The result can be seen in Figure 4. Deepseek ASCII art.

|
|                          Cost at Home: y = 0.294x
|                         /
|                        /
|                       /
|                      /
|                     /
|                    /
|                   /
|                  /
|                 /
|                /
|               /
|              /
|             /
|            /
|           /
|          /
|         /
|        /
|       /
|      /
|     /
|    /
|   /
|  /
| /
|/___________________________ Cost at Work: y = 5.00
|                 17.01 €/kg
|

Figure 4. Deepseek ASCII art

Conclusion

I should stay at the home office until the price of the coffee beans rice to the 23,81€/kg.

If you need the best graph and have Google Colabs at your disposal (it is free) then the best option for you would be ChatGPT but otherwise you can use Gemini or Claude as well. Deepseek is interesting but it is incompatible with my train of thought.

Notes

Image for the article was generated using Imagen3/Gemini with prompt: ”Gemini, Deepseek, ChatGPT and Claude in deep thought while trying to solve the price of the coffee beans.”

The AI assistant of WordPress doesn’t like my text. It corrected some spelling mistakes and thinks that I am using too long sentences and too complex words.

Julkaissut Mai Sahlberg

I'm also known as daFool and auntie Mai. Fuula-setä on nyt Fuula-täti.

Jätä kommentti