﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss Content Posted by David Poole / Article Discussions / Article Discussions by Author  / Pascals Triangle, Home Work and Root Cause Analysis / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 23 May 2013 08:59:07 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Pascals Triangle, Home Work and Root Cause Analysis</title><link>http://www.sqlservercentral.com/Forums/Topic1192655-60-1.aspx</link><description>As a teenager I had a job delivering potatoes to fish and chip shops across the staffordshire plains.  The boss had a book called a ready-reckoner to help calculate the bills.I remember the books of sin/cos/tan tables, normal distribution figures etc.  I also remember that they would contain small rounding errors on specific values as a means of checking whether or not a rival publisher had violated the copyright.My first IT job had me loading 1/4 inch tapes for backup purposes.  You had to master a strange TiChi maneuver to get the ultimate efficient loading technique!Then there was the short straw of having to crawl through the roof space with a crimping tool to wire up a 25 pin plug to connect the mini-computer to dumb terminals.  A job made harder by the fact that the boss used to bribe us with whiskey!Happier times, and as Phil Factor once described, a time when having an interesting personality disorder was a pre-requisite for a career in IT.</description><pubDate>Fri, 21 Oct 2011 16:07:04 GMT</pubDate><dc:creator>David.Poole</dc:creator></item><item><title>RE: Pascals Triangle, Home Work and Root Cause Analysis</title><link>http://www.sqlservercentral.com/Forums/Topic1192655-60-1.aspx</link><description>[quote][b]David.Poole (10/19/2011)[/b][hr]Joe, I should have remembered that.  I think one of your books mentioned storing a calendar table rather than trying to workout calendar maths on the fly.It is so easy to forget that storing a few thousand records for utility sets costs next to nothing but delivers one hell of a lot of utility[/quote]My age is showing with the look up tables I pushed in THINKING IN SETS :-)  I remember when we did not have anything but a slide rule. The books had tables in the back. Finance books had ones  for NPV, IRR; trig and log functions in math books; chemistry had stuff I never understood :-)The other trick is to VALUES() to construct a constant VIEW or a CTE  of this stuff so you can drop it into queries.</description><pubDate>Thu, 20 Oct 2011 12:18:10 GMT</pubDate><dc:creator>CELKO</dc:creator></item><item><title>RE: Pascals Triangle, Home Work and Root Cause Analysis</title><link>http://www.sqlservercentral.com/Forums/Topic1192655-60-1.aspx</link><description>Nice article.</description><pubDate>Thu, 20 Oct 2011 09:30:14 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: Pascals Triangle, Home Work and Root Cause Analysis</title><link>http://www.sqlservercentral.com/Forums/Topic1192655-60-1.aspx</link><description>CELKO - your code does not compile.  Looks like some logic is missing in the case statement.  I don't get " SELECT fact FROM Factrorials WHERE @f = @n "  I @f supposed to be a column or a variable?  I like the idea of it and the recommendation of storing calendar data in table.</description><pubDate>Wed, 19 Oct 2011 15:16:53 GMT</pubDate><dc:creator>pmcpherson</dc:creator></item><item><title>RE: Pascals Triangle, Home Work and Root Cause Analysis</title><link>http://www.sqlservercentral.com/Forums/Topic1192655-60-1.aspx</link><description>Don't you also need to make sure that @n &amp;lt;&amp;gt; @r so you don't divide by 0?  And @r &amp;lt;&amp;gt; 0 either.</description><pubDate>Wed, 19 Oct 2011 15:10:12 GMT</pubDate><dc:creator>pmcpherson</dc:creator></item><item><title>RE: Pascals Triangle, Home Work and Root Cause Analysis</title><link>http://www.sqlservercentral.com/Forums/Topic1192655-60-1.aspx</link><description>Thanks for the great article.  It reminds me of why when I used to fly airplanes my instructor kept telling me that the probability of an engine failure in a twin engine plane was twice as high as a single... of course you still had one engine running in a twin.</description><pubDate>Wed, 19 Oct 2011 13:34:50 GMT</pubDate><dc:creator>richard.rabe</dc:creator></item><item><title>RE: Pascals Triangle, Home Work and Root Cause Analysis</title><link>http://www.sqlservercentral.com/Forums/Topic1192655-60-1.aspx</link><description>Joe, I should have remembered that.  I think one of your books mentioned storing a calendar table rather than trying to workout calendar maths on the fly.It is so easy to forget that storing a few thousand records for utility sets costs next to nothing but delivers one hell of a lot of utility</description><pubDate>Wed, 19 Oct 2011 12:17:18 GMT</pubDate><dc:creator>David.Poole</dc:creator></item><item><title>RE: Pascals Triangle, Home Work and Root Cause Analysis</title><link>http://www.sqlservercentral.com/Forums/Topic1192655-60-1.aspx</link><description>I think you got trapped in teh procedural mindset. I would use a look up table with DECIMAL(s, 0) columns so i can get the range I need. Ther is one for 1 to 23! at http://membres.multimania.fr/rsirdey/facttabl.htmNow, we can apply a little algebra in a CASE expression instead of brute force: CREATE FUNCTION Perm(@n DECIMAL, @r DECIMAL)RETURNS DECIMAL (s,0)ASRETURN  CASE WHEN @r = (0, @n) THEN 1.0           WHEN @r = 1.0 THEN @n      THEN  (SELECT fact FROM Factrorials              WHERE @f = @n)          / (SELECT fact FROM Factrorials              WHERE @f = (@n-@r)       ELSE CAST (NULL AS DECIMAL:(s,0)) END;                   </description><pubDate>Wed, 19 Oct 2011 11:04:54 GMT</pubDate><dc:creator>CELKO</dc:creator></item><item><title>RE: Pascals Triangle, Home Work and Root Cause Analysis</title><link>http://www.sqlservercentral.com/Forums/Topic1192655-60-1.aspx</link><description>Yes, and apparently each space shuttle launch expected at least 6000 components to fail but was still designed to work.On my list of things not to think about is precisely how fast a piece of metal moves inside a motor-bike engine when it's between your legs:-P</description><pubDate>Wed, 19 Oct 2011 09:50:45 GMT</pubDate><dc:creator>David.Poole</dc:creator></item><item><title>RE: Pascals Triangle, Home Work and Root Cause Analysis</title><link>http://www.sqlservercentral.com/Forums/Topic1192655-60-1.aspx</link><description>Good article.Of course, the point you omitted is how the actual probability of any given failure alters the calculations. With the lottery example, because each of the numbers is (supposedly) equally likely to be chosen, Pascal's triangle is a perfect model, and shows the true (im)probability of winning.With the car example, QA testing ensures that parts generally have a much higher probability of working than failing, thus although there's only one way for the whole system to work perfectly, it's more likely than the millions of ways it can fail.</description><pubDate>Wed, 19 Oct 2011 08:10:29 GMT</pubDate><dc:creator>sknox</dc:creator></item><item><title>RE: Pascals Triangle, Home Work and Root Cause Analysis</title><link>http://www.sqlservercentral.com/Forums/Topic1192655-60-1.aspx</link><description>Hi David, This is fantastic! I can find many uses for this..Thanks!</description><pubDate>Wed, 19 Oct 2011 07:50:52 GMT</pubDate><dc:creator>eephus101</dc:creator></item><item><title>RE: Pascals Triangle, Home Work and Root Cause Analysis</title><link>http://www.sqlservercentral.com/Forums/Topic1192655-60-1.aspx</link><description>I enjoyed your article because it was relevant on multiple levels.  Thank you for a well-written article!</description><pubDate>Wed, 19 Oct 2011 07:18:16 GMT</pubDate><dc:creator>Carla Wilson-484785</dc:creator></item><item><title>RE: Pascals Triangle, Home Work and Root Cause Analysis</title><link>http://www.sqlservercentral.com/Forums/Topic1192655-60-1.aspx</link><description>Excellent article.Even better, I see you used to work in Manchester!Paul.Manchester,UK.</description><pubDate>Wed, 19 Oct 2011 02:06:40 GMT</pubDate><dc:creator>paul s-306273</dc:creator></item><item><title>Pascals Triangle, Home Work and Root Cause Analysis</title><link>http://www.sqlservercentral.com/Forums/Topic1192655-60-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/Troubleshooting/75990/"&gt;Pascals Triangle, Home Work and Root Cause Analysis&lt;/A&gt;[/B]</description><pubDate>Wed, 19 Oct 2011 00:14:24 GMT</pubDate><dc:creator>David.Poole</dc:creator></item></channel></rss>