Higher Order Thinking Skills
ERS: INTEGERS
What about distributive property in case of division over addition or subtraction.
Try and find out with the help of an example whether the following are true or not. Give reasons.
a a= (b + c) = (a = b) + (a = c)
b (a + b) = c = (a + c) + (b + c)
ca (6-c) = (a + b)-(a + c)
d (a - b) = c = (a + c) - (b + c)
New Enjoying Mathematics 7
Answers
The trick seems, the absolute values' addition equals to the double of the difference between Max and Min of a, b and c. For example, if a, b, c are 5, 6, 7 then answer is 2*(7-5) = 4.
Merge A B and C into a new array D (this new array should be 2 dimensional keeping value and original array id, i.e. A, B, C)
Sort D in descending order using values
Start from first item.
For each item (say i) find the first and second next items that has different "original array" informations. (So you must have 3 values with A, B and C as their original arrays).
Calculate the difference between the first and last among those 3 numbers(Use the trick stated above).
Save the min difference.
If min and middle ones are consequitive advance to the middle one's index. If min and middle ones are not consequitive advance to one just before the middle one's index. (This let you skip unnecessary checks and gain performance if numbers are not randomly distributed among the sets). And loop through step 4 until you do not find 2 next items.