Construct the recipe for a new probiotic

As a food researcher at large beverage company, you have been tasked with coming up with a secret formula for the next probiotic superfood: water kefir! At any point in time during the fermentation process, the water kefir solution can have four ingredients that react with each other: sugar water, acid, carbon dioxide, and the water kefir culture itself.


You know how each ingredient of the solution changes in one hour:

  • 10% of the sugar water gets converted to acid, and another 15% is converted to the culture.
  • 15% of the acid is converted to carbon dioxide, and 5% is converted to the culture.
  • 45% of the carbon dioxide gets re-absorbed back into acid.
  • The culture does not change into another state.

Given the initial solution contains 80% of sugar water and 20% of culture, find how many hours it will take for the concentration of sugar water to decrease to 11%, and save this as hours. Save the composition of ingredients at this time as the 1d numpy array composition, assuming the following ingredient's order:

1
composition_ingredient_order = ['sugar water', 'acid', 'co2', 'culture']

Your code snippet should define the following variables:

Name Type Description
hours positive integer The number of hours needed to accomplish what is requested in the problem statement.
composition 1d array The composition of ingredients at 'hours'.
user_code.py

Correct answer

Student view placeholder

In student views this area is used for assessment and score info.
Tools

Staff information

Question

Title:
Construct the recipe for a new probiotic

Variant

Started at:
2026-08-05 00:59:59 (CDT)
Duration:
0s
Show/Hide answer
{}
History
dec frac
rad deg