For the following two systems show where the algebraic rules
For the following two systems, show where the algebraic rules are not true:
The rules of algebra may not always be valid in floating point arithmetic. In this problem, you will show where two algebraic rules are not always true when performing calculations in the computer. In algebra, for three real numbers x, y, and z, the distributive property is x(y + z) = xy + xz. Find three numbers where the distributive property is NOT valid when using 4-digit chopped arithmetic. In algebra, for two real numbers x and y, the average value, (x +y)/2, of x and y lies between the values x and y. Find two numbers whose average, (x + y)/2, is NOT between values x and v when using 3-digit chopped arithmetic.Solution
5. i) for three real numbers x, y & z, the distributive property x(y+z) = xy + xz will not be valid when in few cases when x is less than 1. An example of 3 numbers is as below:
x= 0.1, y=0.5555, z = 0.5556
LHS of distributive property using 4-digit chopped arithmetic = 0.1(0.5555+0.5556)=0.1(1.1111)=0.1111
RHS of distributive property using 4-digit chopped arithmetic = 0.1(0.5555) + 0.1(0.5556) = 0.0555+0.0555 = 0.1110
From above, it is clear that LHS is not equal to RHS, thus distributive property is not valid for similar cases as above.
ii) for two real numbers x & y, the averageof two numbers (x+y)/2 lies between values of x & y, will not be valid in few cases when x and y are two adjacent minimum possible numbers. An example of 2 numbers is as below:
x= 0.555 and y=0.556
Average of the two numbers = (0.555+0.556)/2=1.111 / 2 = 0.555
From above, it is clear that average is one of the number and is not in between both numbers. Thus the property is not valid for similar cases as above.
