FA-63173 / Insurance premium rating / Member archive
Calendar period earned and unearned premium: Expired policies contribute negative earnings · case 03
Policies that expired before the period reduce earned premium.
Case contract
Input period [start, end) in days and policies [[written day, term days (>0 else 'invalid term'), premium]]. Earned = premium*overlap/term where overlap = max(0, min(end, w+term) - max(start, w)). Unearned at end counts policies written before end and still in force after it. Sum exactly; round each total half-up once.
Why this case matters
Earned premium is the denominator of every loss ratio, so exposure-overlap slips distort rate indications.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| expired before period | [181373, 0] | [187581, 0] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗