93
$\begingroup$

If you search for "Turn! Turn! Turn!" on Google, then the second result is this YouTube video of The Byrds performing the Pete Seeger song of that name. But the first result is Google's internal calculator displaying "241217.524881". With a bit of experimentation, it appears that this number is a numerical approximation to $$\frac{\Gamma(2\pi+1)^2}{2 \pi},$$ where $\Gamma$ represents the Euler gamma function.

I sort of understand why Google is interpreting "Turn" to mean $2\pi$, and the exclamation mark to mean $x! := \Gamma(x+1)$, as this is a relatively common (although not universal) choice of interpolation of the factorial function to the real numbers. But in that case, I would expect Google to interpret "Turn! Turn! Turn!" to represent $\Gamma(2\pi+1)^3 \approx 18\, 658\, 774\, 329$ instead of the expression above. Why isn't it?

A possible partial solution: if you search "Turn! Turn" then you get the expected result $7735.248 \approx \Gamma(2\pi+1) 2\pi$. But if you search "Turn! Turn!" then you do not get the expected result $\Gamma(2\pi+1)^2 \approx 1\, 515\, 614$. Instead, you get 195.936, which appears to be the numerical approximation of $\Gamma(2\pi+1)/(2\pi)$. Moreover, Google reparses the input as "Turn ! (Turn !)". To me, this suggests that it's interpreting the second explamation mark as a factorial symbol, but the first exclamation mark to mean $a ! b := b/a$, i.e. division but with the usual order of arguments reversed. This explains the orginal result if Google is interpreting "Turn! Turn! Turn!" with the first exclamation mark representing reversed division (with a lower order-of-operations precedence than multiplication) but the second two exclamation marks representing factorial: $$2\pi "!" (((2\pi)!)\ ((2\pi)!)) = \frac{\Gamma(2\pi+1)^2}{2\pi}.$$

Is this notation $a!b := b/a$ standard? I've never seen it before. Can anyone explain how Google is parsing this string?

(This is one of those awkward questions where the (unknown) solution determines whether or not the question is on-topic for Math Stack Exchange. If the solution does indeed come down to unusual math notation, as I suspect, then the question is on-topic for Math SE. But if the resolution is just some black-box machine learning magic, then maybe the question isn't on topic. I'm not quite sure what one does in this kind of situation.)

$\endgroup$
8
  • 3
    $\begingroup$ For what it's worth, typing just 113!355 does not bring up the calculator at all. $\endgroup$ Jul 26, 2021 at 0:37
  • 2
    $\begingroup$ Actually directly searching with paranthesis Turn ! (Turn !) i get Turn ! = 195.936116 Turn which makes even less sense than the other results. Searching for Turn ! Turn ! Turn gives the equally confusing Turn ! Turn = 0.159154943 Turn. $\endgroup$ Jul 26, 2021 at 0:57
  • 3
    $\begingroup$ Just tried Fun! Fun! Fun! but only got a Beach Boys' song... $\endgroup$
    – J.-E. Pin
    Jul 26, 2021 at 2:38
  • 7
    $\begingroup$ In case it changes later, it's worth noting that the calculator interpreted "Turn! Turn! Turn!" as "(Turn ! (Turn !)) (Turn !)". $\endgroup$
    – Mark S.
    Jul 26, 2021 at 13:20
  • 5
    $\begingroup$ When I do a google search on "(Turn ! (Turn !)) (Turn !)" the calculator returns the (sort of expected) result \begin{align} &\text{(Turn ! * (Turn !))* (Turn !)}=\\ 1&865877328.74\ . \end{align} So the insertion of the parentheses in the search term changes the way it gets interpreted. $\endgroup$ Jul 27, 2021 at 5:23

1 Answer 1

74
+100
$\begingroup$

It appears that Google search uses the following syntax for conversions between different units or currencies: target_unit! <expression> (Though I can't find any documentation for this). For example, searching for cm! 1m + 5 yards yields 557.2 centimeters. Interpreting a turn to be a dimensionless quantity equal to $2\pi$, we can try to make sense of the results:

  • Turn ! (Turn !) means "calculate $\text{Turn}!$ and express it in the unit turn", which comes out to $\frac{\Gamma(2\pi +1)}{2\pi}\text{ Turn}$, or approximately $195.936116 \text{ Turn}$ (as observed by Mikael).
  • Turn! Turn! Turn! is interpreted as (Turn ! (Turn !)) * (Turn !), where we make the calculation from the previous bullet point and are left with a product of something in the unit turn and a number, which Google evaluates by throwing away the unit information in the first term and calculating the product of the two numbers. Hence, we end up with $\frac{\Gamma(2\pi+1)}{2\pi}\cdot \Gamma(2\pi+1)$ as the result.
$\endgroup$
7
  • 9
    $\begingroup$ You've cracked the case. So I was right that Google is effectively interpreting a!b to mean $b/a$, but you figured out why: Google's trying to do a unit conversion. $\endgroup$
    – tparker
    Jul 29, 2021 at 2:05
  • 2
    $\begingroup$ One very minor correction to your second bullet regarding the reason why Google's throwing away the unit information. Google actually keeps the unit when you multiply a united quantity by a dimensionless number.... $\endgroup$
    – tparker
    Jul 29, 2021 at 2:07
  • 2
    $\begingroup$ ...However, Google's messing up the units of Turn ! (Turn !). It should indeed be $\Gamma(2\pi+1)/(2\pi)$ Turn as you say, but Google's mistakenly thinking that it's $\Gamma(2\pi+1)/(2\pi)$ rad instead. Moreover, for some reason it's interpreting Turn ! not to be just $\Gamma(2\pi+1)$, but instead $\Gamma(2\pi+1)$ rad (i.e. it's bringing forward the unit of the argument). So Google mistakenly believes that (Turn ! (Turn !)) * (Turn !) is the product of two quantities with the unit of radians. And it's easy to verify that when you multiple two quantities with the unit of radians ... $\endgroup$
    – tparker
    Jul 29, 2021 at 2:19
  • 2
    $\begingroup$ ... together, Google's algorithm just discards the units (because radians$^2$ isn't really a very meaningful unit). So these two errors - Google's mistakenly assigning the unit of radians to two different quantities that shouldn't have that unit - conveniently cancel either other out. $\endgroup$
    – tparker
    Jul 29, 2021 at 2:22
  • 2
    $\begingroup$ One potential correction – you said that "It appears that Google search uses the following syntax for conversions between different units or currencies: target_unit! <expression>" However, I'm not sure that ! is actually playing any significant role; I think it's just being discarded. You point out that "cm! 1m + 5 yards yields 557.2 centimeters", but I get the same result for cm 1m + 5 yards, cm] 1m + 5 yards, and cm' 1m + 5 yards … it looks like Google is just tossing out some symbols that it can't incorporate into the expression. $\endgroup$ Jul 30, 2021 at 16:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .