Published October 27, 2026 ยท Independent educational guide
Measure Overlapping Work Intervals Without Double-Counting
A report about work intervals can overstate coverage simply by adding every row's length. Two rows may overlap, touch at an endpoint, describe the same period or refer to different resources. An AI assistant needs a declared interval convention and a clear question before it can produce a useful total. The sum of individual durations, the time covered by at least one interval and the span from the earliest start to the latest end are different quantities.
This guide uses six original fictional pairs of numerical intervals. Their coordinates are invented ticks on one common axis, not actual calendar times, staff records, reservations or measured machine activity. Each interval includes its start and excludes its end, written [start,end). The downloadable CSV and JSON preserve the inputs and manual expectations. No executable utility or database deployment is supplied. The local and downloaded checks verify arithmetic under this teaching contract, not a real workflow's capacity, permissions, service performance or staffing needs.
State what one interval describes
An interval needs a subject as well as two endpoints. In a real dataset, one row might describe a machine's running period, a person's task, a room reservation or the period during which a condition was recorded. Combining rows requires knowing whether they share the same subject and measurement basis. Two overlapping tasks on different machines do not automatically compete for one machine. Two records for the same machine may instead duplicate or overlap its reported activity. The numerical coordinates alone cannot settle that identity question.
The original exercise deliberately puts each pair on the same authored axis and asks only about numerical lengths. That assumption makes the comparison calculable. It does not assert that actual business rows can be pooled. Before adapting the method, name the resource or population, coordinate units, period scope and any source conditions that explain what the interval represents. If those fields are missing, preserve the uncertainty rather than treating familiar-looking endpoints as evidence of a shared timeline.
A useful first sentence is specific: calculate the length covered by at least one of these two supplied intervals on the same axis. That asks for a union length. Another sentence might ask for the total of all row lengths, which asks for a sum even where rows overlap. Neither wording authorizes a business inference about productivity. Keep the measurement question narrow enough that a reviewer can reconstruct it from the supplied endpoints and understand which quantity the final number actually describes.
Read the endpoint convention before comparing rows
The notation [start,end) means the starting boundary is included and the ending boundary is excluded under the declared exercise. PostgreSQL's range documentation provides primary technical context for inclusive and exclusive bounds and range overlap. This guide does not run PostgreSQL or claim conformance with all of its range behavior. The fictional calculations use ordinary finite numerical endpoints and an explicit local rule, with no unbounded ranges, calendar recurrence or timezone conversion.
Why name the convention? A row ending at ten and another beginning at ten can be adjacent without sharing a positive-length portion under this contract. A different application may represent event endpoints differently. Even where the numerical length is unchanged, a boundary-membership question can have a different answer. A summary should not say that two intervals conflict solely because one displayed endpoint equals the other's start without checking the actual convention and the relevant resource rule.
The duration of a valid finite interval in this exercise is end minus start. That formula produces zero when endpoints are equal and a negative value when reversed. The cases distinguish those situations explicitly. Zero length is permitted as an empty teaching interval; reversed endpoints are rejected as invalid input. This is an authored validation policy for the fixture. It is not a universal rule for every date system, event log or application that stores pairs of values.
Case A: adjacent intervals do not add an overlap
Fictional case A contains [0,10) and [10,20). Each interval has length ten. Their individual lengths sum to twenty, their union length is twenty and their positive overlap length is zero. The shared displayed boundary does not create an extra unit of coverage. Adding one because both rows mention ten would change the endpoint convention and confuse coordinate labels with lengths. The original data contains two intervals, not twenty-one counted coordinate labels.
An assistant can describe them as adjacent under the stated contract. It should not turn that word into a claim that a real handoff is operationally feasible. Actual transitions may require setup, travel, cleanup or a reset period that the numerical intervals do not include. The teaching pair supplies no such requirements. If a real process needs a gap, represent that requirement separately rather than pretending it was established by the arithmetic or assuming that adjacency automatically satisfies it.
The case also separates a continuous coverage question from a count of rows. There are two input rows and one combined covered span. Both statements can be true. A report that counts two periods of work might be describing records, while another report describing twenty ticks of covered length describes the union. Use labels that preserve that distinction. Merging adjacent numerical intervals for a display should not silently erase record identities if those identities are needed for another authorized task.
Case B: subtract the shared part once
Fictional case B contains [0,12) and [8,20). The row lengths are twelve and twelve, totaling twenty-four. The common portion runs from eight to twelve and has length four. The union length is twenty because the four shared ticks should be counted once when measuring coverage by at least one interval. The arithmetic relationship is twelve plus twelve minus four equals twenty. These invented quantities illustrate double-counting, not actual labor hours or machine utilization.
A different question might deliberately retain the sum of twenty-four. If two people each worked for twelve units on separate tasks, total person-time could have that sum while wall-clock coverage differs. But that interpretation would require a defined subject and unit, which the original case does not supply. The same pair of numbers can support several numerical summaries while supporting no particular business explanation. State what the total measures before calling it effort, availability or productivity.
A review can ask the assistant to show both row lengths, the intersection endpoints and the union length. That makes the deduction visible. A result of twenty with no explanation could be correct by coincidence or based on an unstated rule. An explanation that says the second row was discarded would be wrong for the declared coverage task because its portion from twelve to twenty contributes coverage. Preserve partial contribution rather than treating overlap as a reason to remove an entire record.
Case C: an empty interval is not missing evidence
Fictional case C pairs [5,5) with [0,10). The first interval is empty under the exercise's included-start, excluded-end convention and has length zero. The second has length ten. Their sum and union lengths are both ten, and their overlap length is zero. The zero-length row is still supplied input. It is not an omitted row, an unknown endpoint or evidence that a real event failed to happen. Those would be separate interpretations requiring source context.
An application might use equal endpoints to represent an instantaneous event rather than an occupied interval. If so, a count of events and a sum of occupied durations answer different questions. This guide does not infer such an event meaning for case C. It preserves the empty interval as an explicit teaching state and reports its zero contribution to length. A reader should be able to see that the record was considered, not silently dropped because its duration looked unimportant.
Unknown endpoints require another response. If the start or end is missing, end minus start cannot be calculated from the supplied information. Replacing that endpoint with the other one to create a zero-length interval invents a value. The fixture avoids that substitution. A real report can distinguish supplied empty intervals from unresolved intervals and state how each category affects the reported scope. Do not combine them into one blank or zero category merely because the final display has limited space.
Case D: reject reversed endpoints before totaling
Fictional case D contains [12,8) alongside [0,10). The first row violates the declared start-not-after-end rule. The expected case result is invalid, with no total coverage calculation published for the pair. Subtracting to obtain negative four and adding it to ten would produce six, but six is not an accepted union or duration result under the teaching contract. Nor should the assistant silently swap the endpoints and pretend the original record was valid.
A real source might have a documented reason for reversed values, such as a different coordinate convention or an error correction process. That rule must be supplied and reviewed. The original exercise intentionally supplies no repair policy. Its bounded response is to identify the invalid row and leave the pair's requested result unresolved. A draft can propose a question for the source owner, but it cannot establish the corrected endpoints from the shape of the error alone.
Validation should happen before a final total is interpreted. A polished chart or a numerical total can hide invalid rows that were skipped or repaired without disclosure. Report which rows were rejected and why, while respecting the audience and data-access rules of the actual workflow. The teaching case has no private subjects, so it can show the endpoints openly. It does not certify a production validation process, authorize record changes or establish that every reversed pair is a simple transcription mistake.
Case E: a nested interval adds row length but not new coverage
Fictional case E pairs [0,20) with [5,10). The row lengths are twenty and five, totaling twenty-five. The shorter interval is entirely inside the longer one. Their overlap is five and their union length remains twenty. A report describing twenty-five ticks of coverage would count the nested portion twice. A report describing the sum of the two row lengths can correctly say twenty-five, provided it uses that label and does not imply a different measurement.
Nested records are not automatically duplicates. They may describe different activities, levels of detail or resources. The arithmetic establishes containment on the authored axis; it does not establish identical record identity or a reason to delete the shorter row. Before deduplicating real data, determine what each row represents and which task requires preserving it. Sorting or merging numerical intervals can be useful for coverage analysis while leaving the original records intact for other purposes.
This case is especially useful when an AI summary uses the word additional. The shorter row adds five units to a row-length sum, but adds zero units to union coverage. Ask additional to what? A count of activity records, an effort total and elapsed coverage each use a different basis. The example supplies no business metric that makes one basis universally preferable. It helps a reader notice when a sentence moves between bases without changing its wording or explaining the difference.
Case F: distinguish covered length from the surrounding span
Fictional case F contains [0,10) and [12,20). The row lengths sum to eighteen and the union length is eighteen. There is a two-tick gap from ten to twelve. The surrounding span from the earliest start to the latest end has length twenty. Calling the entire span covered would fill the gap with invented activity. Calling the gap an operational delay would also add a cause that the fixture never provides.
A report may need both span and covered length. An elapsed reporting window could include gaps while an activity-coverage measure excludes them. State the denominator if a ratio is calculated. Eighteen divided by twenty is ninety percent for these authored intervals and this authored span. It is not a utilization rate for a real team, a service-level result or a recommended target. A different chosen reporting window could produce a different ratio while the intervals remain unchanged.
Do not hide gaps by drawing a single continuous bar unless the legend and purpose make the aggregation clear. A simplified picture can be useful, but the underlying question should remain recoverable. The fixture records the span, gap and union separately so the explanation can preserve the distinction. This guide offers no observed chart output or browser utility; the downloadable examples are static teaching data. A real visualization needs its own checks against the actual authorized source.
Check resource identity before making capacity claims
The same numerical overlap can have different operational meaning for different resources. Two bookings for one exclusive room may require a conflict review. Two activities on separate rooms may coexist. Two notes about one activity may duplicate a report rather than represent two demands. The arithmetic in case B identifies a shared range only under the exercise's common-axis assumption. It does not determine resource identity, exclusivity, booking validity or permission to move an activity.
A real interval dataset should keep identifiers for the resource, event and source record when available. These fields answer different questions. One event can have several records, and one resource can have many events. A union by resource differs from a union across an entire organization. If an assistant pools everything without stating the grouping key, it may compute a number that has no useful interpretation. Ask for the grouping and inclusion rule before accepting a total.
Also separate planned intervals from observed intervals. A schedule is evidence of a plan; a completed log can have its own collection limitations. Combining planned and observed rows without a label can make a report look more complete while changing what it measures. The original fictional pairs represent neither real plans nor real observations. They are numerical constructions. That deliberate limitation keeps the examples from claiming a business result while still allowing their arithmetic to be checked exactly.
Give an assistant a bounded interval brief
An original teaching brief can say: Treat each pair as finite intervals on the same authored numerical axis. Include starts and exclude ends. Permit equal endpoints as empty intervals and reject a start greater than its end. For valid pairs, report each row length, their sum, intersection length, union length, surrounding span and any gap. Keep the original rows. Do not infer resource conflicts, causes, availability, staffing or permission to change a schedule from the numbers.
For an actual business task, replace the invented assumptions with the real data contract. Supply the coordinate basis, units, grouping key, relevant observation period and rule for invalid or unknown endpoints. If calendar times are involved, resolve their time basis before comparing them; the separate timestamp guide addresses that distinct question. If date-only recurring events are involved, their contract needs separate treatment. This fixture deliberately avoids those complications and makes no claim about calendar imports or time-zone behavior.
Require the explanation to identify which quantity a headline uses. A headline saying total time can conceal whether it means sum, union or span. Ask for the numerator and denominator of any derived ratio, and preserve invalid cases rather than forcing every row into a numerical result. The proposed brief is not a model response or an evaluated prompt. A real implementation needs observations and checks appropriate to its use before a generated summary supports an operating decision.
Verify the supplied endpoints and the published result
The CSV contains the six original interval pairs and the same numerical endpoints as the JSON. The JSON also contains manually specified expectations, including invalid status for case D. The checks parse the actual endpoints, enforce the declared rule and compare each valid result with those expectations. They do not run a scheduling API, a database range operator or a model. This is exact finite arithmetic on invented inputs, not a certification of a statistical or operational application.
After release, the same checks run against the exact downloaded files. Matching bytes and reproducing expectations establish that the published fixture is consistent with the authored exercise. They do not establish that a real dataset is complete, that resources were available or that actual activities occurred. Preserve those distinctions when adapting the worksheet. The useful outcome is a clearer calculation contract that can be applied and evaluated within an authorized real workflow, not a shortcut around its missing evidence.
Frequently asked questions
Why not add every interval's duration?
You can add row lengths when that is the requested quantity. It differs from coverage by at least one interval when rows overlap. Case B has two twelve-tick rows whose sum is twenty-four but whose union is twenty. Name the measurement before interpreting the result. The example does not determine whether a real task needs effort, elapsed coverage or another metric, and it supplies no actual resource or staffing evidence.
Do intervals touching at an endpoint overlap?
Under this exercise's half-open convention, case A's [0,10) and [10,20) have zero overlap length and are adjacent. That does not establish an operationally feasible handoff or eliminate a real setup requirement. Read the actual endpoint and resource contract before making a scheduling conclusion. This page uses numerical teaching coordinates and does not define all calendar, reservation or application conventions.
Is a zero-length interval the same as an unknown duration?
No. Case C supplies equal endpoints and therefore has zero length under the declared rule. An unknown endpoint does not supply enough information for that calculation. Do not replace a missing endpoint with the other endpoint merely to obtain zero. A real system may use equal endpoints for another purpose, such as an instantaneous event, but that interpretation requires its own contract and should remain separate from occupied-length measurement.
Can I repair a reversed interval by swapping endpoints?
Only under an explicitly authorized correction rule supported by the actual source context. Case D deliberately has no repair policy and is marked invalid. Swapping would change the supplied record; adding its negative difference would also violate the teaching calculation. The worksheet does not establish a corrected event, authorize a record update or prove that a reversed pair is a harmless typing error.
Does overlap prove that a resource was double-booked?
No. That conclusion requires resource identity, exclusivity and the meaning of each record, along with the relevant authorization and status. Two numerical intervals can overlap while describing different resources or repeated descriptions of one event. The fictional cases establish only arithmetic on a common authored axis. They do not inspect bookings, verify activity or approve moving, cancelling or creating an event.
Does ninety percent in case F measure productivity?
No. It is the ratio of eighteen ticks of authored covered length to a twenty-tick authored surrounding span. The case supplies no people, tasks, outcomes or collection process. A productivity or utilization claim needs its own definitions and evidence. Keep the ratio's numerator and denominator visible, and do not turn a numerical teaching example into a target or a finding about a real organization.
Original fictional practice data
Original fictional teaching cases, not actual client records, reservations, model outputs, professional review or operating approval. No executable utility is supplied.
| fictional case | a start | a end | b start | b end |
|---|---|---|---|---|
| A | 0 | 10 | 10 | 20 |
| B | 0 | 12 | 8 | 20 |
| C | 5 | 5 | 0 | 10 |
| D | 12 | 8 | 0 | 10 |
| E | 0 | 20 | 5 | 10 |
| F | 0 | 10 | 12 | 20 |
Primary sources and editorial scope
AI-assisted website editorial. Sources read October 27, 2026 America/New_York. Original examples checked independently. No record change, actual client dataset, observed model output, professional review, security certification or operating approval is asserted.