- #1
pivoxa15
- 2,255
- 1
I am doing a computer science course and one exercise is to show that two numbers are within 0.01% of each other.
The first step is to ask how one would define the percentage difference between two numbers?
I would define it as:
[(larger number – smaller number)/ (|the number midway between the two numbers|)] * 100
I think this way is better compared with other ways such as
1. [(larger number – smaller number)/(|smaller number|)] *100
or
2. [(larger number – smaller number)/(|larger number|)] * 100
Mainly because my way allows one to get the same percentage difference between for example, (4,6) and (-4,-6). While the other two ways does not.
Using 1.
(6 – 4)/4 = 50%
(-4 – -6)/|-6| = 33%
Using 2.
(6 – 4)/6 = 33%
(-4 – -6)/|-4| = 50%
Preferred Method.
(6 – 4)/5 = 40%
(-4 – -6)/|-5| = 40%
Do you have any other suggestions?
Thanks
The first step is to ask how one would define the percentage difference between two numbers?
I would define it as:
[(larger number – smaller number)/ (|the number midway between the two numbers|)] * 100
I think this way is better compared with other ways such as
1. [(larger number – smaller number)/(|smaller number|)] *100
or
2. [(larger number – smaller number)/(|larger number|)] * 100
Mainly because my way allows one to get the same percentage difference between for example, (4,6) and (-4,-6). While the other two ways does not.
Using 1.
(6 – 4)/4 = 50%
(-4 – -6)/|-6| = 33%
Using 2.
(6 – 4)/6 = 33%
(-4 – -6)/|-4| = 50%
Preferred Method.
(6 – 4)/5 = 40%
(-4 – -6)/|-5| = 40%
Do you have any other suggestions?
Thanks