Live data from Hacker News

One in five genetics papers contains errors thanks to Excel (2016)

science.org

111–120 of 267 posts

Re: One in five genetics papers contains errors thanks to Excel (2016)

#112

Earlier quoted context omitted.

> I got to the chapter on trig functions and discovered that they'd decided to make angles increase clockwise . That is an established mathematical convention, called "bearing". https://en.wikipedia.org/wiki/Bearing_(navigation) > And there was a graph of the sine function, with the graph below the x-axis from 0 to 180 degrees. But that definitely isn't a convention anywhere; bearing 0 has sine 1. There isn't really…

Regardless of relative directions around circles, the sine and cosine between 0° and 90° can be described unambiguously in terms of ratios between side lengths of right triangles. You could decide to define the functions differently, but then they'd no longer be the sine and cosine, they'd be something else. The whole point of having these two named functions is that they're a common ground, independent of whatever i…

> Regardless of relative directions around circles, the sine and cosine between 0° and 90° can be described unambiguously in terms of ratios between side lengths of right triangles.

That's true, if there are no angles greater than 90° or less than 0°, as is the case in a non-pathological right triangle. In this case, as ratios of nonnegative lengths, all trig functions are always nonnegative.

If you want to include angles outside those bounds, then you care about what exactly occurs where, and while you can unambiguously define angles between 0 and 90 to have all positive trig functions, you can also unambiguously define them to have negative sines and tangents. Fundamentally what's happening is that you're defining certain line segments to have negative length instead of positive length. Which line segments should have negative length isn't a question about angles.

> You can decide to define the functions differently, but then they'd no longer be the sine and cosine, they'd be something else.

Only in a sense much stricter than what people generally use. Sine and cosine themselves are hard to distinguish - you can also call them sine (x) and sine (x - 270). Some people might argue that the sine of (x - 270) is still a sine.

> In general, the two functions can be described by their differential equations

If you do that, you'll completely lose the information about where sine is positive and where it's negative. You can apply any phase shift you want (as long as you apply it to both functions) and their differential equations will look exactly the same.

Re: One in five genetics papers contains errors thanks to Excel (2016)

#113
post #76

Earlier quoted context omitted.

Thanks for looking all this up, particularly the stuff about spreadsheets. I wonder what real early spreadsheets like Lotus 1-2-3 or even Visicalc would do with "-3^2". I have to feel one of the early spreadsheet programmers just made a mistake, because I can't think of a practical reason for going against the mathematical convention if they were already aware of it. Or maybe it comes from bc? ... does bc predate mod…

You've got to go even earlier... which is where the bc link becomes interesting. It's from 1975. Lotus 1 2 3 dates from 1983... I can't find a copy of it that is runnable. VisiCalc would be a good one to look at at 1979. It also presents 9 https://archive.org/details/VisiCalc_1979_SoftwareArts You've also got sc https://en.wikipedia.org/wiki/Sc_(spreadsheet_calculator) from 1981. docker run -it ubuntu:latest # apt-ge…

Why would the expression 2^-2 pose a problem? There is no ambiguity there that requires operator precedence to resolve.

Re: One in five genetics papers contains errors thanks to Excel (2016)

#114
post #88

Earlier quoted context omitted.

No - in a subtle way, you're assuming that the unary minus has precedence, when the point is that it doesn't. You're right that "thing^2" means "thing times thing", but in "-3^2", what is it that is being squared? To write it, as you did, as "(-3) x (-3)", assumes that in "-3^2" the thing being squared is "-3". But that in turn assumes that the unary minus is done before the square. By the standard mathematical conve…

Thanks. I had no idea. Seems counterintuitive at first, but it makes sense, since ’-3’ is '0 - 3'.

This is a good way to think of it. It would be very confusing if “0 - 3^2” and “0 + (-3^2)” should mean different things.

Re: One in five genetics papers contains errors thanks to Excel (2016)

#115

Earlier quoted context omitted.

Regardless of relative directions around circles, the sine and cosine between 0° and 90° can be described unambiguously in terms of ratios between side lengths of right triangles. You could decide to define the functions differently, but then they'd no longer be the sine and cosine, they'd be something else. The whole point of having these two named functions is that they're a common ground, independent of whatever i…

> Regardless of relative directions around circles, the sine and cosine between 0° and 90° can be described unambiguously in terms of ratios between side lengths of right triangles. That's true, if there are no angles greater than 90° or less than 0°, as is the case in a non-pathological right triangle. In this case, as ratios of nonnegative lengths, all trig functions are always nonnegative. If you want to include a…

> If you want to include angles outside those bounds, then you care about what exactly occurs where, and while you can unambiguously define angles between 0 and 90 to have all positive trig functions, you can also unambiguously define them to have negative sines and tangents.

You could define trig functions differently, but then you'd need a separate pair of unnamed functions to express "the ratios of unsigned side lengths of a right triangle in terms of its unsigned interior angles". It's the same reason we don't count "-1 apple, -2 apples, -3 apples, ...". Or why horizonal and vertical lines usually fall on the x-axis and y-axis instead of the (1/√2,1/√2)-axis and (-1/√2,1/√2)-axis. We optimize for the common case.

> If you do that, you'll completely lose the information about where sine is positive and where it's negative. You can apply any phase shift you want (as long as you apply it to both functions) and their differential equations will look exactly the same.

What do you mean? "sin(0) = 0, cos(0) = 1, and for all x, sin'(x) = cos(x), cos'(x) = -sin(x)" is perfectly unambiguous. If you changed the initial conditions, you'd get another pair of functions, but then they'd no longer be the sine and cosine, they'd be some other linear combination. And for that, refer to what I said about the x-axis and y-axis: better to take the stupid simple (0,1) solution and build more complex ones from there.

Re: One in five genetics papers contains errors thanks to Excel (2016)

#116
post #55

Earlier quoted context omitted.

But it's 9! Check it: https://www.mathplanet.com/education/pre-algebra/explore-and... . "You also have to pay attention to the signs when you multiply and divide. There are two simple rules to remember: When you multiply a negative number by a positive number then the product is always negative. When you multiply two negative numbers or two positive numbers then the product is always positive." So basically you have…

No - in a subtle way, you're assuming that the unary minus has precedence, when the point is that it doesn't. You're right that "thing^2" means "thing times thing", but in "-3^2", what is it that is being squared? To write it, as you did, as "(-3) x (-3)", assumes that in "-3^2" the thing being squared is "-3". But that in turn assumes that the unary minus is done before the square. By the standard mathematical conve…

Interesting. In our high school math class when -3^2 was hand written it was ok to interpret it as (-3)^2. But maybe that could have been because spacing would be used as some informal parentheses.

Re: One in five genetics papers contains errors thanks to Excel (2016)

#117
post #116

Earlier quoted context omitted.

No - in a subtle way, you're assuming that the unary minus has precedence, when the point is that it doesn't. You're right that "thing^2" means "thing times thing", but in "-3^2", what is it that is being squared? To write it, as you did, as "(-3) x (-3)", assumes that in "-3^2" the thing being squared is "-3". But that in turn assumes that the unary minus is done before the square. By the standard mathematical conve…

Interesting. In our high school math class when -3^2 was hand written it was ok to interpret it as (-3)^2. But maybe that could have been because spacing would be used as some informal parentheses.

Precedence rules are mostly a formalization of the underlying basic convention that the operations whose terms are written closer together are done first.

Re: One in five genetics papers contains errors thanks to Excel (2016)

#119
post #86

Earlier quoted context omitted.

Sometimes people need to be saved from themselves. E.g. spreadsheets can have mistakes very quickly when people treat them as databases and start copying columns between spreadsheets assuming that the primary keys (e.g. in one column) are identical while they happily add rows and move rows around.

To be fair, there are no good, accessible database tools around for your average non programmer user. Access tried to be this a decade ago, until MS started to let it die. So now, your only option is basically Excel. There's a reason it's the main thing people gravitate into.

> Access tried to be this a decade ago

three decades ago :)

Re: One in five genetics papers contains errors thanks to Excel (2016)

#120

Earlier quoted context omitted.

I had a discussion on one of the Nim boards because Nim does the same, i.e. Writing -2^2=4 but 0-2^2=-4 because Nim treats the first as the unary - which takes precedence over exponentiation. I realise that you can argue how it is technically correct (and interestingly several of the people I was talking with couldn't even get my point), but I still argue it's incredibly unintuitive for anyone coming from an regular…

You're right that violating established mathematical convention can be a deal-killer for some kinds of adoption. A few years ago I was reading the docs for a new programming language, thinking it might be useful in teaching. The docs were well-written and in a beautifully produced book. I got to the chapter on trig functions and discovered that they'd decided to make angles increase clockwise . And there was a graph…

The Godot game engine has its 2d graphics origin at the top-left of the screen, with the positive Y axis pointed down. Having clockwise trig functions is a natural consequence of that.

I think it's a fairly common setup for all 2D graphics software.

Post reply on HN