Introductory Mathematics
One price list, a whole page of purchases
BOTIE
Examples, experiments and workspace controls
Connect a tool's inputs to see what it produces. You can try a branch before connecting it to Result.
Try your own inputs
Change just the bread price. Before looking at the bills, decide which customer should see the largest increase. Then change one customer's purchase and check whether anyone else's bill changes.
Context for this challenge
Collect the loaf and milk lists, then arrange the result so bread precedes milk within every customer row.
Let's return to the purchases from our bookkeeping problem. Before trying to recover unknown prices, we will start with prices we know and work out the bills. One customer's bill is straightforward. Now suppose we have a whole page of purchases. We need to keep each customer's quantities together and apply the same prices to every customer. A table gives us a place for each quantity; we will build the calculation that uses it.
Inspect the component calculation
Swap rows and columns(
Matrix: Collect two results(
First result: Loaves for each customer
Second result: Milk bottles for each customer
)
)Examples and results
- Loaves for each customer
- 01
- 13
- 22
- Milk bottles for each customer
- 02
- 11
- 20
- Required result
1 2 3 1 2 0
- Loaves for each customer
- 00
- 12
- Milk bottles for each customer
- 03
- 11
- Required result
0 3 2 1
Try a fresh construction
This clears this draft, including its undo history. Earlier successful attempts stay recorded. Build again without opening hints to record an independent attempt.
Stuck? Inspect a worked construction
The tools below form one possible solution. You can assemble it, follow its signals, and undo that change to return to your own construction.
Assumptions and test precision
These are invented purchases. The prices are given, and we calculate bills from them. Recovering unknown prices from known bills would require solving a system of equations, which is a different operation. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.
Your last tested pieces can start the full construction. An existing draft there keeps its own pieces.
One customer, fractional prices
This check uses the pieces from “Apply one price list to every customer”.
BOTIE
- Loaves for each customer
- 04
- Milk bottles for each customer
- 00
- Prices: bread, then milk
- 01.5
- 12.25
Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.
Build a construction in the workspace above first. This case will test those pieces.
What does a row identify, and why must the price order match the columns rather than the rows?
A matrix can apply one weighted calculation to many observations while retaining their identities.
These are invented purchases. The prices are given, and we calculate bills from them. Recovering unknown prices from known bills would require solving a system of equations, which is a different operation.
Work through the Python challenges →