Assign shares to the original item
Synthetic bill has shared dish S costing HKD 60, split two-thirds to A and one-third to B, plus A’s drink at HKD 30. No tax, service charge or payment record is supplied. Each item’s fractions must be nonnegative and sum to one under the local allocation rule; therefore no individual share can exceed one. The guest previews are A70 and B20.
| Constraint | Required record | Example decision rule |
|---|---|---|
| Item relation | Original line ID + guest shares | S allocated once across A/B |
| Fraction reconciliation | Nonnegative shares; 2/3 + 1/3 = 1 | Reject negative shares or a sum other than one |
| Amount projection | A40 + drink30; B20 | Preview sum 90 matches original |
Test complete and overlapping shares
| Case | Input | Expected decision |
|---|---|---|
| A2/3,B1/3 | Shared S60 | 40/20; allocation reconciles |
| A2/3,B2/3 | Shares total 4/3 | Reject overlapping allocation |
| A−1,B2 | Sum 1 but negative A share | Reject invalid share domain |
- Read original bill lines
- Record shares per guest
- Check nonnegative shares and a sum of one
- Prepare reconciled guest previews
Unknown shares stay pending; equal splitting must not be assumed when the recorded request is different.
What are A and B’s preview amounts, and does that prove payment?
Show the worked answer
A HKD 70 and B HKD 20, totalling 90. No payment is established because no payment record is supplied.
Request line-level fractions in the export so a corrected share can be traced without replacing the full original bill.