# Bakeoff stall
Bakeoff stall
## One batch
One batch
A batch makes 24 cookies.
A batch makes 24 cookies.
| Ingredient | Qty | Price | Cost | |------------|----:|------:|------:| | Flour | 1.2 | 1.50 | 1.80 | | Butter | 0.5 | 9.00 | 4.50 | | Sugar | 0.6 | 2.00 | 1.20 | | Eggs | 6 | 0.40 | 2.40 | | Chocolate | 0.4 | 14.00 | 5.60 |
| Ingredient | Qty | Price | Cost |
|---|---|---|---|
| Flour | 1.2 | 1.50 | 1.80 |
| Butter | 0.5 | 9.00 | 4.50 |
| Sugar | 0.6 | 2.00 | 1.20 |
| Eggs | 6 | 0.40 | 2.40 |
| Chocolate | 0.4 | 14.00 | 5.60 |
```vmark #batch Cost = Qty * Price batch_cost = SUM(Cost) ```
Cost = Qty * Price
batch_cost = SUM(Cost)
One batch costs **15.50**<!--vmark=batch.batch_cost--> to make.
One batch costs 15.50 to make.
## The stall
The stall
```vmark #stall param price precision 2 in [1.00, 5.00] lattice 0.50 = default 3.00 param batches integer in [1, 6] lattice 1 = default 2 fee = 12.00 piggy_bank = 60.00 goal = 60.00 baked = batches * 24 demand = 160 - 30 * price sold = IF(baked < demand, baked, demand) left = baked - sold spend precision 2 = batches * batch.batch_cost + fee revenue precision 2 = sold * price profit precision 2 = revenue - spend assert spend <= piggy_bank assert profit >= goal assert left <= 12 ```
param price precision 2 in [1.00, 5.00] lattice 0.50 = default 3.00
param batches integer in [1, 6] lattice 1 = default 2
fee = 12.00
piggy_bank = 60.00
goal = 60.00
baked = batches * 24
demand = 160 - 30 * price
sold = IF(baked < demand, baked, demand)
left = baked - sold
spend precision 2 = batches * batch.batch_cost + fee
revenue precision 2 = sold * price
profit precision 2 = revenue - spend
assert spend <= piggy_bank
assert profit >= goal
assert left <= 12
At **3.00**<!--vmark=stall.price--> a cookie she bakes **48**<!--vmark=stall.baked-->, sells **48**<!--vmark=stall.sold--> and makes **101.00**<!--vmark=stall.profit--> on **43.00**<!--vmark=stall.spend--> spent. She wants at least **60.00**<!--vmark=stall.goal--> out of the day and will not spend more than **60.00**<!--vmark=stall.piggy_bank-->.
At 3.00 a cookie she bakes 48, sells 48 and makes 101.00 on 43.00 spent. She wants at least 60.00 out of the day and will not spend more than 60.00.
## What to ask
What to ask
```vmark #sweep report best scalar stall.profit direction max among feasible report gates report forbidden ```
report best scalar stall.profit direction max among feasible
report gates
report forbidden