ArticleslgStudy

computer science

Interval arithmetic

Interval arithmetic is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Interval arithmetic rather than just read about it. In short: Interval arithmetic (also known as interval mathematics, interval analysis or interval computation) is a mathematical technique used to mitigate rounding and measurement errors in mathematical computation by computing function bounds. Numerical methods involving interval arithmetic can guarantee relatively reliable and mathematically correct results.

Interval arithmetic — main illustration
Interval arithmetic — illustration

Key takeaways

  • Interval arithmetic belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Interval arithmetic to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Interval arithmetic from memory before moving on to harder problems.

Reference excerpt

Interval arithmetic (also known as interval mathematics, interval analysis or interval computation) is a mathematical technique used to mitigate rounding and measurement errors in mathematical computation by computing function bounds. Numerical methods involving interval arithmetic can guarantee relatively reliable and mathematically correct results. Instead of representing a value as a single number, interval arithmetic or interval mathematics represents each value as a range of possibilities. Mathematically, instead of working with an uncertain real-valued variable x, interval arithmetic works with an interval [a, b] that defines the range of values that x can have. In other words, any value of the variable x lies in the closed interval between a and b. A function f, when applied to x, produces an interval [c, d] which includes all the possible values for f(x) for all x ∈ [a, b]. Interval arithmetic is suitable for a variety of purposes; the most common use is in scientific works, particularly when the calculations are handled by software, where it is used to keep track of rounding errors in calculations and of uncertainties in the knowledge of the exact values of physical and technical parameters. The latter often arise from measurement errors and tolerances for components or due to limits on computational accuracy. Interval arithmetic also helps find guaranteed solutions to equations (such as differential equations) and optimization problems.

Introduction The main objective of interval arithmetic is to provide a simple way of calculating upper and lower bounds of a function's range in one or more variables. These endpoints are not necessarily the true supremum or infimum of a range since the precise calculation of those values can be difficult or impossible; the bounds only need to contain the function's range as a subset. This treatment is typically limited to real intervals, so quantities in the form

[ a , b ] = { x ∈ R ∣ a ≤ x ≤ b } , {\displaystyle [a,b]=\{x\in \mathbb {R} \mid a\leq x\leq b\},}

where a = −∞ and b = ∞ are allowed. With one of a, b infinite, the interval would be an unbounded interval; with both infinite, the interval would be the extended real number line. Since a real number r can be interpreted as the interval [r, r], intervals and real numbers can be freely combined.

Example

Consider the calculation of a person's body mass index (BMI). BMI is calculated as a person's body weight in kilograms divided by the square of their height in meters. Suppose a person uses a scale that has a precision of one kilogram, where intermediate values cannot be discerned, and the true weight is rounded to the nearest whole number. For example, 79.6 kg and 80.3 kg are indistinguishable, as the scale can only display values to the nearest kilogram. It is unlikely that when the scale reads 80 kg, the person has a weight of exactly 80.0 kg. Thus, the scale displaying 80 kg indicates a weight between 79.5 kg and 80.5 kg, or the interval [79.5, 80.5). The BMI of a man who weighs 80 kg and is 1.80 m tall is approximately 24.7. A weight of 79.5 kg and the same height yields a BMI of 24.537, while a weight of 80.5 kg yields 24.846. Since the body mass is continuous and always increasing for all values within the specified weight interval, the true BMI must lie within the interval [24.537, 24.846]. Since the entire interval is less than 25, which is the cutoff between normal and excessive weight, it can be concluded with certainty that the man is of normal weight. The error in this example does not affect the conclusion (normal weight), but this is not generally true. If the man were slightly heavier, the BMI's range may include the cutoff value of 25. In such a case, the scale's precision would be insufficient to make a definitive conclusion. The range of BMI examples could be reported as [24.5, 24.9] since this interval is a superset of the calculated interval. The range could not, however, be reported as [24.6, 24.8], as the interval does not contain possible BMI values.

Multiple intervals

Height and body weight both affect the value of the BMI. Though the example above only considered variation in weight, height is also subject to uncertainty. Height measurements in meters are usually rounded to the nearest centimeter: a recorded measurement of 1.79 meters represents a height in the interval [1.785, 1.795). Since the BMI uniformly increases with respect to weight and decreases with respect to height, the error interval can be calculated by substituting the lowest and highest values of each interval, and then selecting the lowest and highest results as boundaries. The BMI must therefore exist in the interval

[ 79.5 , 80.5 ) [ 1.785 , 1.795 ) 2 ⊆ [ 24.673 , 25.266 ] . {\displaystyle {\frac {[79.5,80.5)}{[1.785,1.795)^{2}}}\subseteq [24.673,25.266].}

In this case, the man may have normal weight or be overweight; the weight and height measurements were insufficiently precise to make a definitive conclusion.

Interval operators A binary operation ∗ on two intervals, such as addition or multiplication is defined by

… excerpt ends here. Continue reading the full article.

Illustrations

Interval arithmetic: Tolerance function (@media screen{html.skin-theme-clientpref-night .mw-parser-output div:not(.notheme)>.tmp-color,html.skin-theme-clientpref-night .mw-parser-output p>.tmp-color,html.skin-theme-clientpref-night .mw-parser-output table:not(.notheme) .tmp-color{color:inherit!important}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output div:not(.notheme)>.tmp-color,html.skin-theme-clientpref-os .mw-parser-output p>.tmp-color,html.skin-theme-clientpref-os .mw-parser-output table:not(.notheme) .tmp-color{color:inherit!important}}turquoise) and interval-valued approximation (red)
Tolerance function (@media screen{html.skin-theme-clientpref-night .mw-parser-output div:not(.notheme)>.tmp-color,html.skin-theme-clientpref-night .mw-parser-output p>.tmp-color,html.skin-theme-clientpref-night .mw-parser-output table:not(.notheme) .tmp-color{color:inherit!important}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output div:not(.notheme)>.tmp-color,html.skin-theme-clientpref-os .mw-parser-output p>.tmp-color,html.skin-theme-clientpref-os .mw-parser-output table:not(.notheme) .tmp-color{color:inherit!important}}turquoise) and interval-valued approximation (red)
Interval arithmetic: Body mass index for a person 1.80 m tall in relation to body weight m (in kilograms)
Body mass index for a person 1.80 m tall in relation to body weight m (in kilograms)
Interval arithmetic: Body mass index for different weights in relation to height L (in meters)
Body mass index for different weights in relation to height L (in meters)
Interval arithmetic: Multiplication of positive intervals
Multiplication of positive intervals
Interval arithmetic: Values of a monotonic function
Values of a monotonic function

Worked examples

Example 1 — a first encounter with Interval arithmetic

Start with the simplest possible case. Write down what Interval arithmetic claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Interval arithmetic before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Interval arithmetic ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Interval arithmetic

In research
Interval arithmetic appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Interval arithmetic in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Interval arithmetic is common in secondary-school and first-year university syllabi. It links to neighbouring topics Arithmetic, Computer arithmetic, Data types, so understanding it makes those chapters shorter.
In everyday life
Look for Interval arithmetic outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Interval arithmetic in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Interval arithmetic means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Interval arithmetic out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Interval arithmetic in simple terms?

Interval arithmetic (also known as interval mathematics, interval analysis or interval computation) is a mathematical technique used to mitigate rounding and measurement errors in mathematical computation by computing function bounds. Numerical methods involving interval arithmetic can guarantee re…

Why does Interval arithmetic matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Interval arithmetic?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Interval arithmetic.

Tags

  • Arithmetic
  • Computer arithmetic
  • Data types
  • Numerical analysis

Keep exploring