January 7, 2011 at 5:54 am
Craig Farrell (1/6/2011)
Hm, that may have confused you more than helped. I'll wait for Tom if it did. π
:laugh: I am always surprised at how complicated people can make simple things. But I like the pie, although I don't know where you get the infinitely many infinitesimal portions from.
The easy way to look at division is to start from whole number division (excluding negative numbers). The idea here is that if I divide a set of X objects by Y I get Y quotient piles with X/Y objects in each of them and 1 pile with fewer than Y objects in it (any of the piles can be empty). When I try to divide X objects by 0, I've got to have 0 quotient piles so all the X objects would be in the remainder pile, but since I'm working in non-negative numbers X isn't less than 0 so that's not allowed. So it's impossible to divide anything by 0. Generalising to integer division is easy, but integer division is not a restriction of rational (or real) division so further generalisation is difficult (not impossible, but the result isn't rational or real division).
But it's also pretty easy to talk about division into Y piles where Y is a non-negative real (so there are floor(Y) whole piles and 1 fractional pile) and each whole pile contains the same quantity (the quotient quantity: not necessarily an integer amount, may be a rational or real amount) and the fractional pile (if Y wasn't an integer) contains the fraction Y-foor(Y) of the quotient quantity - as long as you don't go into negative numbers (always define division using non-negative numbers, and the generalise to include negative numbers - thinking about a negative number of piles is too difficult).
A slightly less easy way to look at it is to say that division of X by Y is finding the UNIQUE solution Z to the equation X=Y*Z. When Y is zero and X is not, there's no solution so you can't do that division. When Y and X are both zero, any number is a solution to the equation, so there isn't a unique solution and therefor you can't divide by zero. This way of looking at it works for rational, real, and complex division but not for whole number division (but it's easily extenable to cover whole number division) and negative numbers are covered from the start. But defining an incomplete unique inverse isn't a good motivation for having division, whereas sharing something (eg a pie) out is a something that's easy to see a use for.
edit: messed up the quote
Tom
January 7, 2011 at 6:09 am
Brandie Tarvin (1/7/2011)
Don't forget the Mayans, Tom. While they didn't use it in actual math calculations, they understood the concept of zero, nothing, and the need for a placement device well before most of the Western world (except the Babylonians) and they figured it out independent of other resources.
Yeah, Mayan longdates used a zero. The earliest definite dating is about 50 BC I think, but people have suggested they got the idea from the Olmecs, which would mean that the idea was around in Central America before 400 BC.
Tom
January 7, 2011 at 6:40 am
Koen (da-zero) (1/7/2011)
Brandie Tarvin (1/7/2011)
Don't forget the Mayans, Tom. While they didn't use it in actual math calculations, they understood the concept of zero, nothing, and the need for a placement device well before most of the Western world (except the Babylonians) and they figured it out independent of other resources.But apparently they didn't get the concept of 2013 π
(I hope)
Actually, 12 Dec 2012 is simply the last day of the 13th baktun on the Mayan calendar, and 13 Dec 2012 is the start of the 14th. Assuming their calendar ends on 12 Dec 2012 is just a cash-for-fear scam created by certain American and European New Age authors in the 1960s/70s. It's like assuming the end of the world must be coming because your desk calendar only goes to the end of December this year.
The Mayan calendar notation uses powers of 20, and is infinitely extensible by adding more digits to the leading edge. It starts with a particular "day 0" in 3114 BC, and can include negative dates just as easily as positive ones.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
January 7, 2011 at 6:48 am
GSquared (1/7/2011)
Actually, 12 Dec 2012 is simply the last day of the 13th baktun on the Mayan calendar, and 13 Dec 2012 is the start of the 14th. Assuming their calendar ends on 12 Dec 2012 is just a cash-for-fear scam created by certain American and European New Age authors in the 1960s/70s. It's like assuming the end of the world must be coming because your desk calendar only goes to the end of December this year.The Mayan calendar notation uses powers of 20, and is infinitely extensible by adding more digits to the leading edge. It starts with a particular "day 0" in 3114 BC, and can include negative dates just as easily as positive ones.
Allright, I didn't know that. (I must be brainwashed. Damn you Hollywood!)
Thanks for the detailed explanation.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
January 7, 2011 at 6:51 am
GSquared (1/7/2011)
The Mayan calendar notation uses powers of 20, and is infinitely extensible by adding more digits to the leading edge. It starts with a particular "day 0" in 3114 BC, and can include negative dates just as easily as positive ones.
Wait. Negative dates? As in lost time?
Gus, are you saying the Mayans invented DBCC_Timewarp?
January 7, 2011 at 6:58 am
Brandie Tarvin (1/7/2011)
GSquared (1/7/2011)
The Mayan calendar notation uses powers of 20, and is infinitely extensible by adding more digits to the leading edge. It starts with a particular "day 0" in 3114 BC, and can include negative dates just as easily as positive ones.Wait. Negative dates? As in lost time?
Gus, are you saying the Mayans invented DBCC_Timewarp?
No. Negative dates as in AD vs BC kind of thing. BC = "negative dates" on Julian, et al, calendars.
And, yes, I know you weren't being serious. I just have a bit of a Mayan obsession. It was a cool civilization in a lot of ways, regardless of what Mel Gibson thinks of it. π
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
January 7, 2011 at 7:25 am
Math is fun. Was working with my son on negative exponents the other day. Why do we flip it to the denominator? It's what we do, it's the pattern of math, like working with i. I'm not always sure the higher math relates to the real world that well, but more we've "bent" the math to fit the world.
January 7, 2011 at 8:02 am
GSquared (1/7/2011)
Brandie Tarvin (1/7/2011)
GSquared (1/7/2011)
The Mayan calendar notation uses powers of 20, and is infinitely extensible by adding more digits to the leading edge. It starts with a particular "day 0" in 3114 BC, and can include negative dates just as easily as positive ones.Wait. Negative dates? As in lost time?
Gus, are you saying the Mayans invented DBCC_Timewarp?
No. Negative dates as in AD vs BC kind of thing. BC = "negative dates" on Julian, et al, calendars.
And, yes, I know you weren't being serious. I just have a bit of a Mayan obsession. It was a cool civilization in a lot of ways, regardless of what Mel Gibson thinks of it. π
The Mayans are absolutely fascinating as are the less known Olmec. I was really happy to see your posts about the calendar so I didn't have to do it. : -)
--------------------------------------
When you encounter a problem, if the solution isn't readily evident go back to the start and check your assumptions.
--------------------------------------
Itβs unpleasantly like being drunk.
Whatβs so unpleasant about being drunk?
You ask a glass of water. -- Douglas Adams
January 7, 2011 at 8:14 am
GSquared (1/7/2011)
I just have a bit of a Mayan obsession. It was a cool civilization in a lot of ways, regardless of what Mel Gibson thinks of it. π
If I understand the Mayan calendar correctly, isn't is comprised of 13 periods, with each being a exponentially larger than the previous period? Each period alternates between being a period of "light" and "dark" - during the "light" periods is when there is rapid expansion of knowledge, etc.
Hmm, can't find that reference right now to those "light"/"dark" periods, but I did find this: http://en.wikipedia.org/wiki/Maya_calendar
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 7, 2011 at 8:31 am
WayneS (1/7/2011)
GSquared (1/7/2011)
I just have a bit of a Mayan obsession. It was a cool civilization in a lot of ways, regardless of what Mel Gibson thinks of it. πIf I understand the Mayan calendar correctly, isn't is comprised of 13 periods, with each being a exponentially larger than the previous period? Each period alternates between being a period of "light" and "dark" - during the "light" periods is when there is rapid expansion of knowledge, etc.
Hmm, can't find that reference right now to those "light"/"dark" periods, but I did find this: http://en.wikipedia.org/wiki/Maya_calendar
The "13 periods" refers to the baktun. We're currently in the 13th, with the 14th beginning soon. They're not exponentially larger sequentially, the counting system is base-20 and each time-span (except the "year") is 20 times larger than the period "inside" it. The smallest unit on their calendar is the day, the next is 20 days, the next is 13 of those (to more closely match the solar year), the next is 20 "years", the next is 20 of those (400 years as a comparable concept to our base-10 century), and so on up to approximately 5,200 years, which is a baktun, if I remember correctly. The progression doesn't exactly match years, since the Mayans didn't consider the solar year all that important (they're too equatorial for seasons to matter much), so they considered a 360-day "year" good enough. The cycle of Venus was much more important to them, for astrological reasons.
I think the light and dark thing is a New Age concept that was tacked onto the Mayan calendar, but I'm not certain on that. It probably comes from the 9 gods of darkness cycle, but that's more like a 9-day week than something having to do with the larger baktun cycle.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
January 7, 2011 at 8:54 am
Koen (da-zero) (1/7/2011)
Dave Ballantyne (1/7/2011)
Maybe my cynicism level is set to 11 , but are the school's back in πHow far does your cynicism scale go?
Or does it just go up to eleven? :-D:cool:
I guess Dave's cynicism scale must go up to about 1000, because I reckon his view of that clutch of posts was ordinary realism, no cynicism involved.
Tom
January 7, 2011 at 9:04 am
I'm sure Jeff will like this: http://www.pcworld.com/article/215741/microsofts_hotmail_fail_a_bad_sign.html
It's most likely a people/process failure more than SQL Server, but it does give ammunition to the idea that individual cloud customers might not get treated well.
January 7, 2011 at 10:13 am
GSquared (1/7/2011)
The "13 periods" refers to the baktun. We're currently in the 13th, with the 14th beginning soon. They're not exponentially larger sequentially, the counting system is base-20 and each time-span (except the "year") is 20 times larger than the period "inside" it. The smallest unit on their calendar is the day, the next is 20 days, the next is 13 of those (to more closely match the solar year), the next is 20 "years", the next is 20 of those (400 years as a comparable concept to our base-10 century), and so on up to approximately 5,200 years, which is a baktun, if I remember correctly.
I think your "13" is probably a typo for 18 (ie the number xyx is 360X+20y+z)? Also, I think a baktun is 144000 days (a bit less than 400 years) because the first baktun began on 11th August 3114 BC (Gregorian)and if it were 20 times that long we'd still be in the first, not the 13th. Of course there was also a 260 day cycle (of 13 20-day weeks) but I think that's comparatively modern (used after long dates went out of use).
Also, do you not think that the "each exponentially greater than..." thing mentioned by Wayne could be some new-age drivel-merchant's take on positional notation - after all, Mayan long dates were expressed in a positional notation, and the multipliers for the positions are (as usual for positional notations) an exponential sequence (except that one of the 20s is an 18) as in all positional number notations, and given what Dan Brown did to encryption I wouldn't be surprised to see ne of his ilk do that top positional notation.
Tom
January 7, 2011 at 11:16 am
Tom.Thomson (1/7/2011)
GSquared (1/7/2011)
The "13 periods" refers to the baktun. We're currently in the 13th, with the 14th beginning soon. They're not exponentially larger sequentially, the counting system is base-20 and each time-span (except the "year") is 20 times larger than the period "inside" it. The smallest unit on their calendar is the day, the next is 20 days, the next is 13 of those (to more closely match the solar year), the next is 20 "years", the next is 20 of those (400 years as a comparable concept to our base-10 century), and so on up to approximately 5,200 years, which is a baktun, if I remember correctly.I think your "13" is probably a typo for 18 (ie the number xyx is 360X+20y+z)? Also, I think a baktun is 144000 days (a bit less than 400 years) because the first baktun began on 11th August 3114 BC (Gregorian)and if it were 20 times that long we'd still be in the first, not the 13th. Of course there was also a 260 day cycle (of 13 20-day weeks) but I think that's comparatively modern (used after long dates went out of use).
Also, do you not think that the "each exponentially greater than..." thing mentioned by Wayne could be some new-age drivel-merchant's take on positional notation - after all, Mayan long dates were expressed in a positional notation, and the multipliers for the positions are (as usual for positional notations) an exponential sequence (except that one of the 20s is an 18) as in all positional number notations, and given what Dan Brown did to encryption I wouldn't be surprised to see ne of his ilk do that top positional notation.
You're right about the dates. It's been a while since I studied it, which is why I disclaimered with "if I remember correctly".
And yeah, the "exponentially greater" bit does sound like the usual drivel in that crowd.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
January 7, 2011 at 5:47 pm
SQLkiwi (1/6/2011)
Jeff Moden (1/5/2011)
Personally, I'd prefer a NULL to be returned instead of an error...Hmmm. That's an interesting question. I don't like the idea of NULL being overworked (yet again in SQL!) to represent 'attempt to divide by zero'. On balance, I think I prefer the error. You can't legitimately divide by zero, so it's a bug in my code, I would say. Otherwise, why stop there? What should LOG(x) return for x <= 0? NULL again?
By the way, the following also does what you prefer:
SET ANSI_WARNINGS, ARITHABORT OFF;
SELECT 1/0, LOG(-0);
SET ANSI_WARNINGS, ARITHABORT ON;
I resist using NULLIF and COALESCE because they can introduce subtle bugs (incorrect results). It seems safer, to me, to expand them into CASE expressions explicitly. The query parser does that anyway.
Paul
Subtle bugs on NULLIF and COALESCE returning incorrect results? Maybe if you use operands that clash for datatype. Is that what you're referring to or is there some other bug? Also, 1/0 and other things like it produce undefined answers. How is that over working NULL?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 15 posts - 23,026 through 23,040 (of 66,749 total)
You must be logged in to reply to this topic. Login to reply