- Write a method simplify to the class RationalNumber. This method should return the simplified version of the fraction as a tuple.
- To provide results with confidence intervals, a special calculus, so-called interval arithmetic, is introduced in numerical mathematics. Define a class called Interval and provide it with methods for addition, subtraction, division, multiplication, and power (with positive integers only). These operations obey the following rules:
Provide this class with methods that allow operations of the type a + I, a I, I + a, I a, where I is an interval and a is an integer or float. Convert an integer or float into an interval [a,a] first. (Hint: you may want to use function decorators for this; see Section 7.8: Function as decorators.) Furthermore, implement the method __contains__, which enables you to check whether a given number belongs to the interval using the syntax x in I for an object I of type Interval. Test your class by applying...