Re: Are plane tickets real?
« Reply #180 on: April 22, 2020, 08:31:42 AM »
Quote
They were not the same until we did some creative rounding. I could make a distance formula and round it to the nearest light year. I could measure the length of my roof with a tape measure and round it down to 0 light years and it would match the haversine formula. Does that mean I used the haversine formula to measure my roof? No I used a tape measure.
This is probably one of the dumber arguments you've made and it's really showing that you simply don't want to believe you could be wrong.

He's nitpicking over rounding distances to the nearest cm. At this point, I think the most plausible explanation is that iamcpc was trolling all along. Someone who calls rounding distances on a map to the nearest cm "creative rounding" just cannot be serious.

I still haven't made up my mind. He (I'm just going to assume he to avoid horribly tortured sentences) is quite consistent in his views and the topics he tends to engage in and is quite willing to engage, so on balance, I'll give him the benefit of the doubt.

There is an understandable element of caution/cunning about some of his answers, always leaving a way out somewhere. For example he started off saying he trusted Bing's distances, but then later qualified that to mean driving and walking distances, leaving open the possibility of later on dismissing the "red pin" measurement tool which clearly does use the spherical haversine. I'm OK with that, I think it's all part of the game and doesn't necessarily mean he's trolling.

To be honest, I've enjoyed this discussion. It prompted me to research some quite interesting topics and I had fun developing the code I posted. When I started with the idea of testing Bing via code, I really didn't think it'd end up being 200 million values exactly matching with arbitrary distance limits and it would never have got anywhere near that without iamcpc's questioning and prodding. I do like a challenge.

I was pretty sure he would not (at least publicly) change his mind, but perhaps in private, we've introduced a little uncertainty, who knows.

Offline iamcpc

  • *
  • Posts: 832
    • View Profile
Re: Are plane tickets real?
« Reply #181 on: April 23, 2020, 04:43:35 AM »
He's nitpicking over rounding distances to the nearest cm.

This is math. If I put two numbers onto a website which says that it adds two numbers and I put the number 1 in twice and the answer is 2.0000000005 then the code that's running on that website, VERY VERY clearly is not adding two numbers. If it was then the answer would have been 2.0000000000. So when it comes to mathematical functions like this the results of a formula like haversine can only have one answer.

If I took a math test and I put 1 + 1 = 1.9999999999999999999999999999995

the answer is WRONG. I get an F on my test. My math teacher is a troll! Nit picking over such a small variance!!!!! I guess every math teacher and match major, and engineer is a troll.


I was pretty sure he would not (at least publicly) change his mind, but perhaps in private, we've introduced a little uncertainty, who knows.

I have changed my mind. At the beginning of this conversation

When the discussion about the red pin distances started:
I was only 55% sure that the Bing red pin distance was based on the haversine formula. Access to the bing API will be able to increase that percent.

At this point:
I'm like 65% sure that the Bing red pin distance is based on various algorithms one of which appears to be based on the haversine formula with some rounding involved. Access to the bing API will be able to increase that percent.

The fact is, after all of this, ALL of you should be fairly confident that the bing API is not 100% haversine. It's VERY clear that there is rounding and converting going on behind the scenes.



iamcpc was trolling all along Someone who calls rounding distances on a map to the nearest cm "creative rounding" just cannot be serious.


If you think i'm a troll or lying then please stop responding to me. I'm here trying to engage people with an open, yet skeptical, mind.
« Last Edit: April 23, 2020, 04:55:52 AM by iamcpc »

*

Offline stack

  • *
  • Posts: 3583
    • View Profile
Re: Are plane tickets real?
« Reply #182 on: April 23, 2020, 05:05:15 AM »
The fact is, after all of this, ALL of you should be fairly confident that the bing API is not 100% haversine. It's VERY clear that there is rounding and converting going on behind the scenes.

Microsoft probably is doing some rounding in addition to haversine, haversine being stated by them as to what they use. The fact of the matter is that their distances match globe earth calculations. If they clandestinely used some other calculation their distance output would be vastly different than, let's say, Google Maps - And it's not.

*

Offline GreatATuin

  • *
  • Posts: 310
  • It's turtles all the way down
    • View Profile
Re: Are plane tickets real?
« Reply #183 on: April 23, 2020, 06:25:16 AM »
He's nitpicking over rounding distances to the nearest cm.

This is math. If I put two numbers onto a website which says that it adds two numbers and I put the number 1 in twice and the answer is 2.0000000005 then the code that's running on that website, VERY VERY clearly is not adding two numbers. If it was then the answer would have been 2.0000000000. So when it comes to mathematical functions like this the results of a formula like haversine can only have one answer.

If I took a math test and I put 1 + 1 = 1.9999999999999999999999999999995

the answer is WRONG. I get an F on my test. My math teacher is a troll! Nit picking over such a small variance!!!!! I guess every math teacher and match major, and engineer is a troll.

Bing rounds to the nearest centimeter because greater accuracy makes absolutely no sense on an online map. Pretending this is "creative rounding" is either trolling, or what I'd call a very creative understanding of how software development and engineering in general work.
« Last Edit: April 23, 2020, 06:55:08 AM by GreatATuin »
Nearly all flat earthers agree the earth is not a globe.

you guys just read what you want to read

Re: Are plane tickets real?
« Reply #184 on: April 23, 2020, 08:42:32 AM »
The fact is, after all of this, ALL of you should be fairly confident that the bing API is not 100% haversine. It's VERY clear that there is rounding and converting going on behind the scenes.

Microsoft probably is doing some rounding in addition to haversine, haversine being stated by them as to what they use. The fact of the matter is that their distances match globe earth calculations. If they clandestinely used some other calculation their distance output would be vastly different than, let's say, Google Maps - And it's not.

I'll hand it to iamcpc, he does get me thinking creatively.

The latest sticking point is rounding. That got me thinking. Could we bypass rounding altogether as an issue by preventing Bing from rounding any numbers? If I were writing their code, I'd use the Math.round function to round, so what if we could disable that function, get it to just return the unadulterated number instead of rounding it. Yep, that works a treat. Here is my hijack of the rounding function...

Code: [Select]
Math.round = function (v) { return v; };
I've included new code as an attachment as usual. As set up, our code does no actual rounding at all in our haversine distance calculation and we're not (yet) attempting to hijack the rounding function, so if you run it, expect to see something like this:

Comparison between 1000000 locations
Min variation 0.0000036mm
Max variation 5.0mm
Avg variation 2.5mm
Min variation(%) 4.3e-14
Max variation(%) 0.024
Avg variation(%) 2.5e-8
Min dist 0.01743km
Max dist 20037.494km
Avg dist 10014.35624km

As expected, because Bing is rounding and we aren't, we get a 5mm max variation. Note also that the min/max/avg distances are rounded to 5 decimal places for readability.

Now remove the // comments on line 2 of the code to engage the hijack of the rounding function and run again. This time, any attempt to round anywhere, either our code or Bing's won't do anything at all. Here's the result.

Comparison between 1000000 locations
Min variation 0.0mm
Max variation 0.0mm
Avg variation 0.0mm
Min variation(%) 0.0
Max variation(%) 0.0
Avg variation(%) 0.0
Min dist 0.07886966971510709km
Max dist 20037.506423042065km
Avg dist 10028.233812273153km

So now Bing's unrounded results are being compared with our unrounded results. There is no rounding going on at all and we still get a 100% match. Note also that the rounding of the min/max/avg distances to 5 decimal places isn't working either - as expected.

So there we go, all the argument about rounding is moot because there isn't any going on any more.

Note: Once you've hijacked the round function, it stays hijacked until the browser window is refreshed and the code re-pasted, so bear this in mind if you want to try turning this on and off.

Re: Are plane tickets real?
« Reply #185 on: April 24, 2020, 08:47:13 AM »
He's nitpicking over rounding distances to the nearest cm.

This is math. If I put two numbers onto a website which says that it adds two numbers and I put the number 1 in twice and the answer is 2.0000000005 then the code that's running on that website, VERY VERY clearly is not adding two numbers. If it was then the answer would have been 2.0000000000. So when it comes to mathematical functions like this the results of a formula like haversine can only have one answer.

If I took a math test and I put 1 + 1 = 1.9999999999999999999999999999995

the answer is WRONG. I get an F on my test. My math teacher is a troll! Nit picking over such a small variance!!!!! I guess every math teacher and match major, and engineer is a troll.

I know that my last post takes away the whole rounding issue in relation to Bing, but I want to come back to this exact answer nonsense because you keep saying things like this and you are wrong.

Suppose I say to you what's 1/3 + 2/3. The answer is obvious, right? But suppose I say write the two numbers down as decimals and then add them by hand...

0.3333333333.......
0.6666666666.......
----------------------
0.9999999999.......

No matter how many digits you pick, the answer is 0.999..... etc. The only way you can ever get the correct answer from this is if you round the answer up. If you insist on never rounding, you can never make this add up to 1.

Now try this: https://jsfiddle.net/jbcq3x95/. Put in 0.75 for A and 0.75 for B and press the "Add" button. As expected the answer is exactly 1.5, but now try 0.1 + 0.1. You get:

0.1 + 0.1 = 0.2000000000000000111022302462515654042363

So what's going on here? Computers work in binary. The number 0.1 in binary is 0.0001100110011[0011 repeated forever]. It's a simple number to deal with in base 10, but not in base 2, because you need an infinite number of bits and you don't have that, you actually have 53 (in a typical modern computer). That's why, when you add 0.1 and 0.1 together on a computer, you don't get 0.2 unless you round the answer.

Reciprocal powers of 2 in combination will always be fine, so 1/2, 1/4, 1/8, 1/16 etc. That's why 0.75 + 0.75 is exact because it's (1/2 + 1/4) + (1/2 + 1/4) and these are all reciprocal powers of 2.

Offline iamcpc

  • *
  • Posts: 832
    • View Profile
Re: Are plane tickets real?
« Reply #186 on: April 27, 2020, 02:47:39 PM »
0.3333333333.......
0.6666666666.......
----------------------
0.9999999999.......

No matter how many digits you pick, the answer is 0.999..... etc. The only way you can ever get the correct answer from this is if you round the answer up. If you insist on never rounding, you can never make this add up to 1.

It was 7th grade math when I was taught that .9 repeating = 1

https://www.purplemath.com/modules/howcan1.htm


0.1 + 0.1 = 0.2000000000000000111022302462515654042363

So what's going on here? Computers work in binary. The number 0.1 in binary is 0.0001100110011[0011 repeated forever]. It's a simple number to deal with in base 10, but not in base 2, because you need an infinite number of bits and you don't have that, you actually have 53 (in a typical modern computer). That's why, when you add 0.1 and 0.1 together on a computer, you don't get 0.2 unless you round the answer.

Reciprocal powers of 2 in combination will always be fine, so 1/2, 1/4, 1/8, 1/16 etc. That's why 0.75 + 0.75 is exact because it's (1/2 + 1/4) + (1/2 + 1/4) and these are all reciprocal powers of 2.

This is a good logical argument which presents more evidence that the original haversine formula is different than the formula use by bing because the original haversine formula does not deal with binary numbers!
« Last Edit: April 27, 2020, 02:49:22 PM by iamcpc »

*

Offline JSS

  • *
  • Posts: 1618
  • Math is math!
    • View Profile
Re: Are plane tickets real?
« Reply #187 on: April 27, 2020, 03:12:49 PM »
This is a good logical argument which presents more evidence that the original haversine formula is different than the formula use by bing because the original haversine formula does not deal with binary numbers!

That statement makes no sense, and shows you don't understand some basic math concepts.

A formula works no matter what base you use.  Binary, decimal, hexadecimal, those are ways of representing numbers. A formula or equation doesn't care which you pick. There is no 'Decimal Haversine ' or 'Binary Haversine' formulas.

Example Equation: X+X=2X

Decimal: 10+10=20
Binary: 1010+1010=10100
Hex: A+A=14
Roman: X+X=XX
Unary: 1111111111+1111111111=11111111111111111111

See, it doesn't matter what base you use.  So claiming Bing doesn't use Haversine (after seeing hundreds of millions of matching calculations) because it runs on a computer that uses binary at some point, is a completely invalid argument.

Re: Are plane tickets real?
« Reply #188 on: April 28, 2020, 09:35:50 AM »
This is a good logical argument which presents more evidence that the original haversine formula is different than the formula use by bing because the original haversine formula does not deal with binary numbers!
Let's just have a look at the underlying maths as this seems to be confusing you no end.

let r be the radius of a sphere
let A=(φ1, λ1) and B=(φ1, λ1) be two points on a sphere where φ1, φ2 are the latitudes and λ1, λ2 are the longitudes of the two points
let d  be the great circle distance between two points
Imagine a line from A to the centre and another line from B to the centre. The angle at the centre where these two lines meet is called the central angle
let Θ be the central angle between the two points A,B on the sphere

then

hav(Θ) = hav(φ2 - φ1) + cos(φ1) cos(φ2) hav(λ2 - λ1) [ this is core of the haversine formula ]

and

d = r archav(Θ)

So these two formulae when combined allow us to work out the central angle between A and B and from this, the great circle distance.

Note that there are no numbers used at all in either of these formulae, there is nothing to say what units you should use or whether you should use binary, octal, decimal, duodecimal, hex or any other base for your values.

So what is hav? hav is a trigonometrical function just like sine and cosine. The haversine formula is so called because it is based on the haversine (hav) trigonometrical function. hav is an obscure one, so for convenience we can use trigonometrical identities to reformulate using the more familiar sin cos and tan.

hav(θ) = sin2(θ / 2) = (1 - cos(θ)) / 2

And we end up with

d = 2r arcsin(√(sin2((φ2 - φ1) / 2) + cos(φ1) cos(φ2) sin2(λ2 - λ1))

And we can use another trigonometrical identity to replace the arcsin with arctan

arcsin(θ) = arctan(θ / √(1 - θ2))

Giving us (assuming I've got the brackets right)

d = 2r arctan(√(sin2((φ2 - φ1) / 2) + cos(φ1) cos(φ2) sin2(λ2 - λ1)) / √(1 - sin2((φ2 - φ1) / 2) + cos(φ1) cos(φ2) sin2(λ2 - λ1)))

And this is the formulation we have chosen to implement in code.

Note that this formulation does include an actual number, the number 2, but this isn't decimal 2, it's just the number 2 in some base which could be 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 etc. etc.

We can trivially rewrite this final formulation by replacing every number 2, wherever it occurs, with (1+1) and then you can't even rule out binary as as base for haversine.

d = (1+1)r arctan(√(sin(1+1)((φ2 - φ1) / (1+1)) + cos(φ1) cos(φ2) sin(1+1)(λ2 - λ1)) / √(1 - sin(1+1)((φ2 - φ1) / (1+1)) + cos(φ1) cos(φ2) sin(1+1)(λ2 - λ1)))

Furthermore we can see that the original formulation is equally valid and that didn't include any numbers at all, so basically, the number base is utterly irrelevant to haversine.

Saying haversine doesn't use binary numbers is a non sequitur, you can equally say haversine doesn't use decimal numbers either.

Offline iamcpc

  • *
  • Posts: 832
    • View Profile
Re: Are plane tickets real?
« Reply #189 on: April 28, 2020, 02:57:06 PM »

That statement makes no sense, and shows you don't understand some basic math concepts.

A formula works no matter what base you use.  Binary, decimal, hexadecimal, those are ways of representing numbers. A formula or equation doesn't care which you pick. There is no 'Decimal Haversine ' or 'Binary Haversine' formulas.

Example Equation: X+X=2X


WRONG this has been shown by the post below:


Now try this: https://jsfiddle.net/jbcq3x95/. Put in 0.75 for A and 0.75 for B and press the "Add" button. As expected the answer is exactly 1.5, but now try 0.1 + 0.1. You get:

0.1 + 0.1 = 0.2000000000000000111022302462515654042363

So what's going on here? Computers work in binary. The number 0.1 in binary is 0.0001100110011[0011 repeated forever]. It's a simple number to deal with in base 10, but not in base 2, because you need an infinite number of bits and you don't have that, you actually have 53 (in a typical modern computer). That's why, when you add 0.1 and 0.1 together on a computer, you don't get 0.2 unless you round the answer.

Reciprocal powers of 2 in combination will always be fine, so 1/2, 1/4, 1/8, 1/16 etc. That's why 0.75 + 0.75 is exact because it's (1/2 + 1/4) + (1/2 + 1/4) and these are all reciprocal powers of 2.


in binary x + x does not always equal 2x.





Saying haversine doesn't use binary numbers is a non sequitur, you can equally say haversine doesn't use decimal numbers either.

Online is a binary version of the haversine formula. The formula that you discussed in your post uses the traditional base 10 number system.
« Last Edit: April 28, 2020, 03:01:12 PM by iamcpc »

Re: Are plane tickets real?
« Reply #190 on: April 28, 2020, 05:00:37 PM »

That statement makes no sense, and shows you don't understand some basic math concepts.

A formula works no matter what base you use.  Binary, decimal, hexadecimal, those are ways of representing numbers. A formula or equation doesn't care which you pick. There is no 'Decimal Haversine ' or 'Binary Haversine' formulas.

Example Equation: X+X=2X


WRONG this has been shown by the post below:


Now try this: https://jsfiddle.net/jbcq3x95/. Put in 0.75 for A and 0.75 for B and press the "Add" button. As expected the answer is exactly 1.5, but now try 0.1 + 0.1. You get:

0.1 + 0.1 = 0.2000000000000000111022302462515654042363

So what's going on here? Computers work in binary. The number 0.1 in binary is 0.0001100110011[0011 repeated forever]. It's a simple number to deal with in base 10, but not in base 2, because you need an infinite number of bits and you don't have that, you actually have 53 (in a typical modern computer). That's why, when you add 0.1 and 0.1 together on a computer, you don't get 0.2 unless you round the answer.

Reciprocal powers of 2 in combination will always be fine, so 1/2, 1/4, 1/8, 1/16 etc. That's why 0.75 + 0.75 is exact because it's (1/2 + 1/4) + (1/2 + 1/4) and these are all reciprocal powers of 2.


in binary x + x does not always equal 2x.


In the perfect realm of maths, x + x = 2x always. On a calculator or a computer that is not true. It's nothing to do with binary, it's simply a fact that both have limited storage capacity, so either a computer or a calculator has a biggest number it can handle in its internal storage, so if you add 1 to that number, it can't handle it. It doesn't matter what base is being used. In maths you can write c = 2πr and that's an exact statement, but if you want to make an actual calculation using that equation, you need to assign a value to π and you just have to accept that value can't be exact, because however you choose to store that number, calculator, computer, paper, you have a finite amount of room for it.

The mathematical formula for haversine is perfect. It has no units and there is no base, because there are no numbers involved. The minute you want to use it to answer a question, you need paper or a computer or a calculator and you have exactly the same issues of storage and accuracy.


Saying haversine doesn't use binary numbers is a non sequitur, you can equally say haversine doesn't use decimal numbers either.

Online is a binary version of the haversine formula. The formula that you discussed in your post uses the traditional base 10 number system.

No it isn't, the formula I discussed is not base anything any more than saying c = 2πr is in base whatever. You can calculate a value for c using c = 2πr in any base you like.

*

Offline JSS

  • *
  • Posts: 1618
  • Math is math!
    • View Profile
Re: Are plane tickets real?
« Reply #191 on: April 28, 2020, 05:59:13 PM »

That statement makes no sense, and shows you don't understand some basic math concepts.

A formula works no matter what base you use.  Binary, decimal, hexadecimal, those are ways of representing numbers. A formula or equation doesn't care which you pick. There is no 'Decimal Haversine ' or 'Binary Haversine' formulas.

Example Equation: X+X=2X

WRONG this has been shown by the post below:

Now try this: https://jsfiddle.net/jbcq3x95/. Put in 0.75 for A and 0.75 for B and press the "Add" button. As expected the answer is exactly 1.5, but now try 0.1 + 0.1. You get:

0.1 + 0.1 = 0.2000000000000000111022302462515654042363

So what's going on here? Computers work in binary. The number 0.1 in binary is 0.0001100110011[0011 repeated forever]. It's a simple number to deal with in base 10, but not in base 2, because you need an infinite number of bits and you don't have that, you actually have 53 (in a typical modern computer). That's why, when you add 0.1 and 0.1 together on a computer, you don't get 0.2 unless you round the answer.

Reciprocal powers of 2 in combination will always be fine, so 1/2, 1/4, 1/8, 1/16 etc. That's why 0.75 + 0.75 is exact because it's (1/2 + 1/4) + (1/2 + 1/4) and these are all reciprocal powers of 2.

in binary x + x does not always equal 2x.

You didn't manage to grasp the meaning of my post or the one you quoted.

If you want to understand how equations and numeric bases are separate you are going to have to read more carefully.

You also have to figure out the difference between pure math, and actually calculating it with physical hardware. In the real world you will have rounding inaccuraces no matter what base you use.

Do you think base-10 has some magic properties, or that it is what real numbers are, and binary is somehow fake?

There is nothing special about base-10. We just picked it. Any other base works equally well.

Saying haversine doesn't use binary numbers is a non sequitur, you can equally say haversine doesn't use decimal numbers either.

Online is a binary version of the haversine formula. The formula that you discussed in your post uses the traditional base 10 number system.
[/quote]

There is no such thing as a "binary version' of a formula.  I am not sure how else to explain it. X+X has nothing to do with any bases.

Offline iamcpc

  • *
  • Posts: 832
    • View Profile
Re: Are plane tickets real?
« Reply #192 on: April 28, 2020, 06:48:49 PM »
You also have to figure out the difference between pure math, and actually calculating it with physical hardware. In the real world you will have rounding inaccuraces no matter what base you use.

Again it depends on the base. In base 10 .1 is not an infinite number.  in base 10 .1 + .1 = .2. No rounding whatsoever. No inaccuracies whatsoever.  so .1 + .1 is different in base 10 than it is in binary.

Do you think base-10 has some magic properties, or that it is what real numbers are, and binary is somehow fake?

No just that match in base 10, as has been demonstrated in previous posts, is different than math in bindary.


There is nothing special about base-10. We just picked it. Any other base works equally well.
binary sure seems to have some issues with adding .1 and .1



There is no such thing as a "binary version' of a formula.  I am not sure how else to explain it. X+X has nothing to do with any bases.

lets test this formula x + x = 2x with the number .1

in base 10:
.1 + .1 = .2


Now try this: https://jsfiddle.net/jbcq3x95/.  0.1 + 0.1. You get:

0.1 + 0.1 = 0.2000000000000000111022302462515654042363

in binary
x + x <> 2x



There is no such thing as a "binary version' of a formula.  I am not sure how else to explain it. X+X has nothing to do with any bases.

the example above suggest otherwise




 In maths you can write c = 2πr and that's an exact statement, but if you want to make an actual calculation using that equation, you need to assign a value to π and you just have to accept that value can't be exact, because however you


We're not talking about an infinite irrational number like pi. We are talking about .1 and mathematically those two numbers are very different.
« Last Edit: April 28, 2020, 06:53:44 PM by iamcpc »

*

Offline JSS

  • *
  • Posts: 1618
  • Math is math!
    • View Profile
Re: Are plane tickets real?
« Reply #193 on: April 28, 2020, 08:18:48 PM »
You also have to figure out the difference between pure math, and actually calculating it with physical hardware. In the real world you will have rounding inaccuraces no matter what base you use.

Again it depends on the base. In base 10 .1 is not an infinite number.  in base 10 .1 + .1 = .2. No rounding whatsoever. No inaccuracies whatsoever.  so .1 + .1 is different in base 10 than it is in binary.

Do you think base-10 has some magic properties, or that it is what real numbers are, and binary is somehow fake?

No just that match in base 10, as has been demonstrated in previous posts, is different than math in bindary.

Again you are completely missing the entire point of this whole discussion, which is pretty far from plane tickets and Bing at this point anyway.

You are converting back and forth between base 10 and base 2.  That introduces small rounding errors.

Formulas don't use bases, they are symbolic.

How do you express A+B=C in binary or decimal? You don't because it's a symbolic expression. A formula doesn't care what base you calculate it in.

This is a very simple, very basic concept. Decimal or binary is just a way to express numbers. Math is NOT different between decimal and binary. The numbers are expressed differently but the math is the same.

Re: Are plane tickets real?
« Reply #194 on: April 28, 2020, 10:12:22 PM »
Quote
in base 10:
.1 + .1 = .2


Now try this: https://jsfiddle.net/jbcq3x95/.  0.1 + 0.1. You get:

0.1 + 0.1 = 0.2000000000000000111022302462515654042363

in binary
x + x <> 2x

.1 in base 10 has a different value than .1 in binary so of course .1+.1 in base 10 will not equal .1 + .1 in binary.


Re: Are plane tickets real?
« Reply #195 on: April 28, 2020, 10:43:57 PM »
You also have to figure out the difference between pure math, and actually calculating it with physical hardware. In the real world you will have rounding inaccuraces no matter what base you use.

Again it depends on the base. In base 10 .1 is not an infinite number.  in base 10 .1 + .1 = .2. No rounding whatsoever. No inaccuracies whatsoever.  so .1 + .1 is different in base 10 than it is in binary.

Sure but in base 10, 1/3 (as a decimal) is a repeating decimal, but in base 3, it's 0.1. The issue is exactly the same, whatever base you pick you will find some simple fractions which require an infinite series of digits after the radix point (i.e. the dot). These problem numbers may well be different for each base you pick, but they exist nonetheless.

In the realm of mathematics, these are not a problem. You can write them down if you invent a special notation such as 0.3 with a bar or dot above the 3 to indicate infinite repetition. Computers don't have this concept so the best you can do on a computer is fill as many available bits as you can (53) to get get as close to 1/3 as you can. Let's say that 53 bits is approximately equivalent to 16 decimal digits, so the best you can do is say that 1/3 is 0.3333333333333333, but the problem here is you can't tell the difference between a genuine 1/3 and 0.3333333333333333 (16 digits) or 0.33333333333333333333 (20 digits), because you can only store 16 digits in total. You end up with (in this case) 3 different numbers, which are all indistinguishable because all you can ever see is the first 16 digits. It's ambiguous.

Do you think base-10 has some magic properties, or that it is what real numbers are, and binary is somehow fake?

No just that match in base 10, as has been demonstrated in previous posts, is different than math in bindary.

The maths is the same, the nature of the problem is the same, the actual set of problem numbers varies depending on the base.


There is nothing special about base-10. We just picked it. Any other base works equally well.
binary sure seems to have some issues with adding .1 and .1

In much the same way as you'd have problems dealing with 1/3 in base 10.

There is no such thing as a "binary version' of a formula.  I am not sure how else to explain it. X+X has nothing to do with any bases.

lets test this formula x + x = 2x with the number .1

in base 10:
.1 + .1 = .2


Now try this: https://jsfiddle.net/jbcq3x95/.  0.1 + 0.1. You get:

0.1 + 0.1 = 0.2000000000000000111022302462515654042363

in binary
x + x <> 2x


This is nothing to do with binary, the same problems exist in every base whenever you have a limited number of digits you can store. If I tell you you can only store one digit, then in base 10, 1/3 + 1/3 = 3/5 because 0.3 + 0.3 = 0.6. You can improve things by using more digits, but you're just pushing the problem down the road. At some point you run out of digits and if the numbers you are dealing with require more digits than are available, you don't get entirely accurate results.


There is no such thing as a "binary version' of a formula.  I am not sure how else to explain it. X+X has nothing to do with any bases.

the example above suggest otherwise




 In maths you can write c = 2πr and that's an exact statement, but if you want to make an actual calculation using that equation, you need to assign a value to π and you just have to accept that value can't be exact, because however you


We're not talking about an infinite irrational number like pi. We are talking about .1 and mathematically those two numbers are very different.

But in the world of computers, the problem is exactly the same, you can't store the exact value of pi and you can't store the exact value of 1/3 either.

Offline iamcpc

  • *
  • Posts: 832
    • View Profile
Re: Are plane tickets real?
« Reply #196 on: April 30, 2020, 12:45:47 AM »
In the realm of mathematics, these are not a problem. You can write them down if you invent a special notation such as 0.3 with a bar or dot above the 3 to indicate infinite repetition. Computers don't have this concept so the best you can do on a computer is fill as many available bits as you can (53) to get get as close to 1/3 as you can. Let's say that 53 bits is approximately equivalent to 16 decimal digits, so the best you can do is say that 1/3 is 0.3333333333333333, but the problem here is you can't tell the difference between a genuine 1/3 and 0.3333333333333333 (16 digits) or 0.33333333333333333333 (20 digits), because you can only store 16 digits in total. You end up with (in this case) 3 different numbers, which are all indistinguishable because all you can ever see is the first 16 digits. It's ambiguous.

This does not change the fact that, on a computer, x + x = 2x is not always true as you have demonstrated. So the Bing API has limitations of modern computer science as you have described above in addition to the rounding and converting most likely in the API.

Offline BRrollin

  • *
  • Posts: 265
    • View Profile
Re: Are plane tickets real?
« Reply #197 on: April 30, 2020, 01:57:34 AM »
In the realm of mathematics, these are not a problem. You can write them down if you invent a special notation such as 0.3 with a bar or dot above the 3 to indicate infinite repetition. Computers don't have this concept so the best you can do on a computer is fill as many available bits as you can (53) to get get as close to 1/3 as you can. Let's say that 53 bits is approximately equivalent to 16 decimal digits, so the best you can do is say that 1/3 is 0.3333333333333333, but the problem here is you can't tell the difference between a genuine 1/3 and 0.3333333333333333 (16 digits) or 0.33333333333333333333 (20 digits), because you can only store 16 digits in total. You end up with (in this case) 3 different numbers, which are all indistinguishable because all you can ever see is the first 16 digits. It's ambiguous.

This does not change the fact that, on a computer, x + x = 2x is not always true as you have demonstrated. So the Bing API has limitations of modern computer science as you have described above in addition to the rounding and converting most likely in the API.

I agree. It is true only to a certain precision. So what? This is how the real world is!

The only time that equation is ever perfectly true is in pure mathematics. Real life numbers always have some uncertainty.

How long is your hand? Now how long is your forearm? Do you think the length of your hand plus your forearm is exactly the sum of those two lengths? No! Because you don’t know either length perfectly.

Whenever we talk about physical numbers it is always to some precision. The smart thing to do would be to analyse whether the rounding errors caused by the website are large enough to impact the current debate.

I think what you’ll find is that they are not. Not even close.

So this argument of yours is baseless. What are you going to do, claim you don’t know the length of your hand just because you can’t count every single atom? Just grab a ruler and measure the damn thing.

It not worth it to be this obtuse.
“This just shows that you don't even understand the basic principle of UA...A projectile that goes up and then down again to an observer on Earth is not accelerating, it is the observer on Earth who accelerates.”

- Parsifal


“I hang out with sane people.”

- totallackey

Re: Are plane tickets real?
« Reply #198 on: April 30, 2020, 09:37:43 AM »
So the Bing API has limitations of modern computer science as you have described above in addition to the rounding and converting most likely in the API.

Bingo. And not just the Bing API, but everything ever run on a computer has the same limitations. That's why computers typically deal differently with two types of number. The set of integers, in maths, referred to as are all the whole numbers, anything which can be written without a fractional part (e.g. -19, 0, 120). The set of real numbers, includes all the whole numbers (i.e. members of ), plus all fractions, plus all the irrational numbers such as π. In maths, is a superset of . In a computer they are treated separately.

Integers within a certain range can be stored exactly on computers. Operations which combine integers to form other integers, such as addition and multiplication are always exact, but the results may exceed the storage capacity and overflow. Integer division is allowed, but the fractional part of the result is ignored, so 8/3 = 2. That's just the way it is.

Real numbers can sometimes be stored exactly, e.g. 0.5, because as noted before, that's 1/2 and requires only 1 bit in a binary computer, but oftentimes, real numbers are only approximations in a computer because the exact representation exceeds the 53 bits that you have available. Again, just the way it is.

Computers typically have a dedicated processor (either on a separate chip or integrated into the CPU chip) just to deal with floating point numbers, usually called a floating point unit (FPU) or a maths co-processor. The integer stuff is dealt with by the separate arithmetic logic unit (ALU).

In a perfect mathematical world, we wouldn't need to go to all this effort, we'd just need a single processing unit to deal with all numbers and an infinite amount of memory to store these numbers in, but computers are part of the real world, so have to be engineered to work around these issues as well as possible.

But let's get back to Bing and put this in perspective. The real numbers we deal with here, due to the inherent limitations of our computers, probably have capacity of around 16 significant figures (decimal notation), so for a maximum distance possible in our measurements of 20,000km (1/2 way around the world), that means 11 decimal places are available e.g. 20,000.00000000001 (16 in all). The "1" here is 10 nanometres, so we're saying Bing's values are mathematically accurate to 10 nanometres in 20,000 km. To be fair, since we're combining several steps to get the final result and each step can have an inaccuracy, the result may be out by a bit more than 10 nanometres, but that's for an extreme distance. For much shorter distances, the calculated values will be much closer to the theoretical mathematical result.

Microsoft, as we've demonstrated, round their results to the nearest 1cm, meaning that on this scale, the inaccuracies introduced by the computer itself are utterly irrelevant.

Offline iamcpc

  • *
  • Posts: 832
    • View Profile
Re: Are plane tickets real?
« Reply #199 on: May 01, 2020, 04:26:08 PM »
Bingo. And not just the Bing API, but everything ever run on a computer has the same limitations. That's why computers typically deal differently with two types of number. The set of integers, in maths, referred to as are all the whole numbers, anything which can be written without a fractional part (e.g. -19, 0, 120). The set of real numbers, includes all the whole numbers (i.e. members of ), plus all fractions, plus all the irrational numbers such as π. In maths, is a superset of . In a computer they are treated separately.



This is then yet even more evidence that the bing API is not based on the haversine formula! The real true haversine formula is not constrained by limited memory where the bing API one is.
« Last Edit: May 01, 2020, 04:27:39 PM by iamcpc »