tag:blogger.com,1999:blog-17920832426607652472014-10-04T18:35:07.906-07:00Learning MathematicaCongruent Lighthttp://www.blogger.com/profile/10982995395745927023noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-1792083242660765247.post-67463162783448741502009-08-09T19:12:00.001-07:002009-08-09T19:12:33.706-07:00video hosting business modelsI used screencast.com to upload my latest video presentation. Mainly I used this because I did not have my access to Amazon S3 setup yet and it was hooked directly into my Camtasia V4 platform I used to record the video.<br /><br />Apparently the guy who I worked with on the video is fairly popular on the Mma newsgroup. So one night last week I announced it on a newsgroup he frequents with a URL to screencast.com.<br /><br />So early the next morning I get a notice from screencast saying that my free account is about to be shut off because I have used up 75% of my 2GB data transfer allowance on my free account. This did not make sense because I know the video compressed down to only about 50 MB.<br /><br />But maybe the people on that group wanted to see it. So I purchased the $9.95/month pro account from screen cast. This gives 25GB of storage and 200GB of data transfer each month.<br /><br />Then I downloaded and installed FireFox (no! :-) because it has a Amazon S3 plug-in. And I practiced uploading and downloading from there. My plan was to move all my stuff over to S3 (at the end of the month) because it is way cheaper, right? Uhhh?<br /><br />I tell lots of people to use Amazon's S3 service because it is only pennies per GB of storage and transfer rate. I looked out there this week and it was $0.17/GB to tranfer data from their server. That's way less than screencast, right?<br /><br />But if you figure it out, 200GB for $10/month is actually only $0.05 per GB!<br /><br />So if you look at the break even point, around 50GB tranfering out of Amazon is about the same as screencast charges. The next 150GB is cheaper on screencast!<br /><br />So even though many people with Macs have had trouble seeing the video, lots of people have downloaded it and I have transferred more more than 2.5GB (+1.5GB on the free account) out of screencast so far. At 50MB per viewing, that could be 75 viewings, probably isn't...just me testing 50+ times! :-)<br /><br />Finally, if I make a video (or a set) that will be viewed sufficiently many times to transfer more than 50GB of data, screencast.com would be the way to go.<br /><br />Regards..Congruent Lighthttp://www.blogger.com/profile/10982995395745927023noreply@blogger.com0tag:blogger.com,1999:blog-1792083242660765247.post-85016993111900630342009-08-09T15:37:00.000-07:002009-08-09T15:42:08.871-07:00video about publishing in MathematicaI have posted 2 versions of this:<br /><br />the PC version is <a href="http://www.screencast.com/users/Indivisible/folders/Default/media/f77644eb-4f44-449b-ace8-4907ac7480f0">here</a>.<br /><br />the Mac version is <a href="http://www.screencast.com/users/Indivisible/folders/Default/media/343a7474-0df6-48b4-86fb-54a6310d664e">here</a><br /><br />Also this was originally announced <a href="http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/thread/15d688da8c6827a2/df581c13e158c1ea?hl=en#df581c13e158c1ea">here</a><br /><br />I am interested in any and all comments.<br /><br />Regards..Congruent Lighthttp://www.blogger.com/profile/10982995395745927023noreply@blogger.com0tag:blogger.com,1999:blog-1792083242660765247.post-1437571588186647782009-07-12T05:31:00.000-07:002009-07-12T05:43:11.808-07:00the "rain Google Columbus" questionIn David Huynh's <a href="http://mqlx.com/~david/parallax/">Parallax faceted browser for Freebase</a>, his video describes how to use the application to answer the following question: <em>give me a list of schools attended by the children of Republican presidents</em>.<br /><br />This is another example of a query that you cannot answer using a search engine. In fact, it is a Semantic Web type query.<br /><br />I attended <a href="http://blog.freebase.com/2009/06/26/two-weeks-til-freebase-hack-day-sign-up-now/">the Freebase hack-day</a> and I spoke to David about Parallax. While describing W|A, I posited another query that Alpha may answer one day and that Mathematica (with a suitably written program) can answer today. This question is:<br /><br /><em>How many days in 2009 did the Google stock price decline on the same day that is rained in Columbus Ohio?</em><br /><br />It is interesting to note that (according to a Metaweb engineer), Freebase cannot answer the Google component of this question either! :-)<br /><br />This is a simple calculation using the Mathematica primitives and curated data. This is explained in detail in the short series <em>rain Google Columbus</em> <a href="http://files.meetup.com/1343579/rain%20Google%20Columbus%201.pdf">Part 1</a>, <a href="http://files.meetup.com/1343579/rain%20Google%20Columbus%202.pdf">Part 2</a> and <a href="http://files.meetup.com/1343579/rain%20Google%20Columbus%203.pdf">Part 3</a>. There is also <a href="http://www.google.com/search?hl=en&q=rain+Google+Columbus&aq=f&oq=&aqi=">the Google query results</a>. As stated earlier, it is not a fair question to ask Google.<br /><br />We wanted to answer the rain Google Columbus question. The answer is: there are 26 trading days in the first half of 2009 when the Google stock price declined (compared to the previous day) and it rained in Columbus Ohio more than 0.3 inches on the same day.<br /><br />Of course this could be done with some other stock (not GOOG), some other finance-related data (not amount closing price declined), some other city (not Columbus) and some other weather-related data (not rainfall).<br /><br />We derived this answer using Mathematica curated WeatherData[] and FinancialData[]. We made a routine to return the precipitation in Columbus on a particular day. Then we computed which days the stock price declined. Then we passed that list of dates to the precipitation computation and resticted the list to rainy days.<br /><br />In addition to the curated data functions, we also looked at some other Mathematica constructs such as:<br />1) functional programming (i.e. no loops are used, only Map[], Apply[], etc.)<br />2) pure and nested pure functions<br />3) assorted list manipulation techniques (e.g. interleaving)<br /><br />Regards..Congruent Lighthttp://www.blogger.com/profile/10982995395745927023noreply@blogger.com0tag:blogger.com,1999:blog-1792083242660765247.post-7684403449299007102009-06-08T09:38:00.001-07:002009-06-08T09:38:40.241-07:00Polyominoes and Graph LayoutsI have been doing some experiments with plotting graphs and their layouts. Apparently one method of layout of disconnected graphs is called "polyominoes". And this is a generalization of the word "dominoes". :-)<br /><br />A log of one of my experiments with annotation is stored <a href="http://files.meetup.com/1343579/Disconnected%20Graph%20Layout%20with%20Polyomino%20packing.pdf">here</a>.<br /><br />Regards..<br />Ref: <a href="http://www.ics.uci.edu/~eppstein/junkyard/polyomino.html">The Geometry Junkyard</a>Congruent Lighthttp://www.blogger.com/profile/10982995395745927023noreply@blogger.com0tag:blogger.com,1999:blog-1792083242660765247.post-37815757178778686232009-05-30T22:21:00.000-07:002009-05-30T22:26:28.796-07:00what Alpha knowsDue to its large store of terms, W|A makes great attempts at <a href="http://www.wolframalpha.com/input/?i=disambiguation">disambiguation</a>. Because of this certain queries will display multiple possible references.<br /><br />One of the weaknesses of Alpha is opacity of the volume data behind it. Everyone (I guess) finds something they did not expect, then gets excited to look for something <em>near by</em> in their own mind. They type in the near by term, to find Alpha has gone stupid saying repeatedly: "W|A does not know what to do with your input".<br /><br />There are 2 ways to find out more about "what Alpha knows"<br /><br />One is the More dropdown button. In <a href="http://www.wolframalpha.com/screencast/introducingwolframalpha.html">Wolfram's Overview video</a>, he shows what happens when <a href="http://www.wolframalpha.com/input/?i=Springfield">"Springfield"</a> is entered and how the more button shows other Springfields.<br /><br />Another example of the <em>information behind</em> is the Assumptions and suggestions. For example, "Springfield" can be used <a href="http://www.wolframalpha.com/input/?i=Springfield&a=*C.Springfield-_*Miscellaneous-&a=*DPClash.CityE.Springfield-_**Springfield.Oregon.UnitedStates-.dflt-">"as a phrase"</a>.<br /><br />The query that really showed this to me is <a href="http://www.wolframalpha.com/input/?i=cookie">"cookie"</a>.<br /><br />There are 5 separate other <em>assumptions</em> as well as more than 20 other things in the <em>more</em> boutton.<br /><br />Each of these are other valid queries that result in info about <em>what Alpha knows</em>. Have at it!<br /><br />Regards..<br /><br />Roger Williams<br />Franklin LaboratoryCongruent Lighthttp://www.blogger.com/profile/10982995395745927023noreply@blogger.com0tag:blogger.com,1999:blog-1792083242660765247.post-70010779407968641732009-05-25T19:21:00.000-07:002009-05-25T19:33:22.901-07:00some example Alpha queries by SWolframThe breadth of this list is amazing.<br /><br />First some "Higher Math", let's <a href="http://www.wolframalpha.com/input/?i=integrate+x%5E4+sin%5E3+x+dx">integrate x^2 sin^3 x dx</a><br /><br />Now some civics, how about <a href="http://www.wolframalpha.com/input/?i=gdp+france">gdp france</a><br /><br />And some "civics with arithmetic", <a href="http://www.wolframalpha.com/input/?i=what+is+the+gdp+of+france+%2F+belgium">what is the gdp of france / italy</a><br /><br />And some "internet statistics", <a href="http://www.wolframalpha.com/input/?i=internet+users+in+europe%2C+china%2C+us">internet users in europe compared to china and the US</a><br /><br />And some "geography", <a href="http://www.wolframalpha.com/input/?i=springfield">springfield</a><br /><br />And some "meterology", <a href="http://www.wolframalpha.com/input/?i=weather+springfield">weather springfield, for the last 5 years</a><br /><br />And some "meterology on a date", <a href="http://www.wolframalpha.com/input/?i=weather+springfield+11%2F6%2F89">weather springfield 11/6/89</a><br /><br />And some "meterology related to a particular day", <a href="http://www.wolframalpha.com/input/?i=weather+in+chicago+when+barack+obama+was+born">weather in chicago when barack obama was born</a><br /><br />And "a speed value", <a href="http://www.wolframalpha.com/input/?i=5+miles%2Fsec">5 miles/sec</a><br /><br />And "an earnings or charging rate", <a href="http://www.wolframalpha.com/input/?i=%2417%2Fhour">$17/hour</a><br /><br />And "a temperature", <a href="http://www.wolframalpha.com/input/?i=6000C">6000C</a><br /><br />And "a quantity of text", <a href="http://www.wolframalpha.com/input/?i=6000+words">6000 words</a><br /><br />And some "info about a word", <a href="http://www.wolframalpha.com/input/?i=accretion+word">accretion</a><br /><br />And "an amount of a precious metal", <a href="http://www.wolframalpha.com/input/?i=133+g+of+gold">133 g of gold</a><br /><br />And some "chemistry", <a href="http://www.wolframalpha.com/input/?i=2.5+molar+H2SO4">2.5 molar H2SO4</a><br /><br />And some "more chemistry", <a href="http://www.wolframalpha.com/input/?i=water+2.5+atm+200C">water 2.5 atm 200C</a><br /><br />And some "medicine, a number from a test", <a href="http://www.wolframalpha.com/input/?i=ldl+50">LDL 50</a><br /><br />And the "same test for a particular demographic", <a href="http://www.wolframalpha.com/input/?i=LDL+50+smoker+male+age+40">LDL 50 smoker male age 40</a><br /><br />And "comparing 2 tests for that demographic", <a href="http://www.wolframalpha.com/input/?i=LDL+vs.+serum+potassium+male+age+40+smoker">LDL vs. serum potassium male age 40 smoker</a><br /><br />And "another common medical test", <a href="http://www.wolframalpha.com/input/?i=psa+0.04">psa 0.04</a><br /><br />And some "straight demographics", <a href="http://www.wolframalpha.com/input/?i=life+expectancy+male+age+42+finland">life expectancy male age 40 finland</a><br /><br />And "someone's stats", <a href="http://www.wolframalpha.com/input/?i=5%278%22+160+lbs">5'8" 160 lbs</a><br /><br />And some "calculations about someone with those stats", <a href="http://www.wolframalpha.com/input/?i=running+4+mph+30+minutes+5%278%22+160+lbs+age+40+female">running 4 mph 30 minutes 5'8" 160 lbs age 40 female</a><br /><br />And some "bioinformatics, a DNA sequence", <a href="http://www.wolframalpha.com/input/?i=ATAGTCCTAGTTAAA">ATAGTCCTAGTTAAA</a><br /><br />And let's "pick a gene from the sequence", <a href="http://www.wolframalpha.com/input/?i=LRRIQ3">gene FASTKD2</a><br /><br />And let's "computation near that gene", <a href="http://www.wolframalpha.com/input/?i=500+bp+upstream+LRRIQ3">500 bp upstream gene FASTKD2</a><br /><br />And "a stock symbol", <a href="http://www.wolframalpha.com/input/?i=msft">MSFT</a><br /><br />And "comparing 2 companies stock", <a href="http://www.wolframalpha.com/input/?i=MSFT+Apple">MSFT Apple</a><br /><br />And some "mortgage finance", <a href="http://www.wolframalpha.com/input/?i=mortgage+5%25+30+years">mortgage 5% 30 years</a><br /><br />now use 10000 euros<br /><br />And some "financial arithmetic", <a href="http://www.wolframalpha.com/input/?i=bond+7%25+21+years">bond 7% 21 years</a><br /><br />now change the yield<br /><br />And some "engineering, an airfoil computation", <a href="http://www.wolframalpha.com/input/?i=NACA+4351+17+deg">NACA 4351 15 deg</a><br /><br />And some "assorted colors", <a href="http://www.wolframalpha.com/input/?i=red+%2B+green">red + yellow</a><br /><br />And "a musical scale", <a href="http://www.wolframalpha.com/input/?i=D%23+minor">D# minor</a><br /><br />now play it<br /><br />And some "website info", <a href="http://www.wolframalpha.com/input/?i=www.apple.com">www.apple.com</a><br /><br />now show history<br /><br />And some "social sciences", <a href="http://www.wolframalpha.com/input/?i=high+school+teacher+median+wages">high school teacher median wages</a><br /><br />And some "more social sciences", <a href="http://www.wolframalpha.com/input/?i=france+fish+production">france fish production</a><br /><br />And some "comparative social science", <a href="http://www.wolframalpha.com/input/?i=france+fish+production+vs.+poland">france fish production vs. poland</a><br /><br />And some "nutrition", <a href="http://www.wolframalpha.com/input/?i=Vitamin+c+in+214g+orange+juice">Vitamin c in 214g orange juice</a><br /><br />And "a dynamic calorie chart", <a href="http://www.wolframalpha.com/input/?i=2+cups+OJ+%2B+1+slice+cheddar+cheese">2 cups OJ + 1 slice cheddar cheese</a><br /><br />And some "searching for a crossword entry", <a href="http://www.wolframalpha.com/input/?i=a__t_r">a__t_r</a><br /><br />And "back to geography", <a href="http://www.wolframalpha.com/input/?i=mt+everest">mt everest</a><br /><br />And some "computations with that", <a href="http://www.wolframalpha.com/input/?i=height+mt+everest+%2F+length+golden+gate+bridge">height mt everest / length golden gate bridge</a><br /><br /><a href="http://www.wolframalpha.com/input/?i=length+brooklyn+bridge+%2F+length+golden+gate+bridge">more</a><br /><br /><a href="http://www.wolframalpha.com/input/?i=length+brooklyn+bridge+%2F+depth+indian+ocean">more</a><br /><br />And some "computational geography", <a href="http://www.wolframalpha.com/input/?i=3rd+largest+country+in+europe">3rd largest country in europe</a><br /><br />And some "comparative geography", <a href="http://www.wolframalpha.com/input/?i=gdp+vs.+railway+length+in+europe">gdp vs. railway length in europe</a><br /><br />And some "civics", <a href="http://www.wolframalpha.com/input/?i=president+of+brazil+in+1922">president of brazil in 1922</a><br /><br />And "a name", <a href="http://www.wolframalpha.com/input/?i=andrew">andrew</a><br /><br />And "two names", <a href="http://www.wolframalpha.com/input/?i=andrew+sally">andrew paul</a><br /><br />And some "probabilities", <a href="http://www.wolframalpha.com/input/?i=10+flips+2+heads">10 flips 2 heads</a><br /><br />And a "numerical sequence", <a href="http://www.wolframalpha.com/input/?i=3%2C+7%2C+15%2C+31%2C+63%2C+...">3, 7, 15, 31, 63, ...</a><br /><br />And some "US aeronautics", <a href="http://www.wolframalpha.com/input/?i=iss">ISS</a><br /><br />Regards..Congruent Lighthttp://www.blogger.com/profile/10982995395745927023noreply@blogger.com1tag:blogger.com,1999:blog-1792083242660765247.post-39087878156030998832009-05-23T20:43:00.000-07:002009-05-23T21:09:45.808-07:00Wolfram|Alpha and non-searchable questionsWolframAlpha and non-searchable questions<br /><br /><strong>What it is not </strong><br /><br />This product was widely panned in the blogosphere during its first week after release. But I want you to know...<br /><br />WolframAlpha is not a search engine. It says it is a computational knowledge engine.<br /><br />One obvious way to see this is to submit this string (<em>stopping power air, 0.731MeV electron</em>) into both products, like this <a href="http://www95.wolframalpha.com/input/?i=stopping+power+air%2C+0.731MeV+electron">WA Query</a> and this <a href="http://www.google.com/search?hl=en&q=stopping+power+air%2C+0.731MeV+electron&aq=f&oq=&aqi=">Google Query</a>.<br /><br />The <em>answer</em> if you could call it that is equal to computing the stopping power of a material.<br /><br />WolframAlpha gives a bunch of numbers and graphs. I am not sure if these are correct. I am not a student of nuclear physics.<br /><br />The Google result is significantly more disappointing. Specifically, no answer, not even a bunch of numbers for which I cannot validate their veracity.<br /><br />The reason is that WolframAlpha did not search the web for the answer to this question. Google did. Neither Google nor Wolfram can find it on the web, because it is not on the web!!<br /><br /><strong>It does it while you wait<br /></strong><br />The Alpha product computed the answer in real time. Now maybe this is a parlor trick.<br /><br /><p>We could give the string from the Alpha examples page (<em>fuel cost 50 miles, 20 mpg, $2.09/gal</em>). Now Google finds the question because it crawled Alpha's page. But, it still does not have the answer! Because the answer is not on the web! And if you make the miles in the question 507, it has to be recomputed. It cannot be looked up.<br /><br />So what I have been doing is giving Alpha questions that I know are not on the web. Maybe, <em>cube root of longitude of chicago</em>. Does this make any sense?<br /><br />Well, it certainly makes numerical sense. What Alpha does in this case is to "parse" this phrase which is almost English into a few functions. I guess that this is where the NKS stuff came in. I certainly do not understand that!<br /><br /><strong>Now the meat of it<br /></strong><br />Anyway, Alpha has "curated data" containing lots of cities around the globe. In this data are properties of those cities. One property that has been curated is longitude. This is a number (a magnitude) with units degrees.<br /><br />Alpha has a version Mathematica running underneath it. Mathematica has a function to perform a cube root of a number. So Alpha asks Mathematica to compute the cube root of the magnitude and return it, which is very trivial for Mathematica.<br /><br />Then Alpha displays the result. Does this question make sense? Does the question: compute-me-the-cube-root-of-longitude-of-chicago make sense?<br /><br />I don't think so. I think that it is probably a non-sensical value.<br /><br /><strong>The cost to become a champion<br /></strong><br />But when I first used Alpha and I saw it had some sports stuff, the first thing I wanted was "Tiger Woods: number of strokes career".<br /><br />Alas, I could not compute this with Alpha's help. This number might be out on the web. Or someone might be working to keep such a number and post it on the web in the future. When it is out there, Goggle will crawl it and find it.<br /><br />But it will be static. There probably will not be an application out there which will compute it for you whenever you want. Unil the Alpha curators put all of Tiger's matches in the DB. Then it will appear and you will be able to do other calculations with it.<br /><br />I used to ask avid golfers: "Can you average under 90 if you only play once a week?" Most said no. I don't think Alpha knows this one either.<br /><br /><strong>Other non-searchable, questions which can be asked now to Alpha<br /></strong><br />Some other queries which cannot be searched by anyone, they must be computed:<br /><br />- <em>square of molecular weight of iron<br /></em>- <em>eleventh largest US state</em> (or thirteenth or 23rd)<br />- <em>2nd highest elevation in Africa</em><br />- <em>orbital position of the international space station</em>; of course Alpha will give a different answer at different times<br />- <em>square root of longitude of chicago</em><br />- <em>father's mother's sister's son's aunt's brother's father</em> (play with adding more relations to the end of the string "..sister's husband's mother's father"<br />- <em>Vitamin c in 214g orange juice</em> (try 271 grams)<br />- <em>elevation des moines, minneapolis, phoenix</em><br /><br /><strong>Are these queries nonsense?<br /></strong><br />Of course these can be seen as non-sensical. Their absurdity does again point to a parlor trick.<br /><br />Maybe it is just a savant who can detangle complicated English expressions easily. It is certainly possible.<br /><br />When curated-data was added to Mathematica V6 & V7, I assumed it was for social scientists who wanted to ask: "How does the rainfall in Iowa vary with the square root of the annual in-migration to the US between 1936 and 1947?" With Mathematica and the requisite curated data, you can answer this question.<br /><br />Further a great deal of the curated data is also based in the sciences. It has lots of stuff like nuclear physics and computational biology and chemical compound properties.<br /><br />So this meant (to me) that scientists could ask their own "nonsensical questions" as part of their research.<br /><br />And Alpha's plan is to broaden the scope of people who can ask these types of non-searchable questions and get an answer. And as more data becomes curated (as so much in our world is going that way), Alpha will be able to answer an infinitum of sense-less questions.<br /><br /><strong>Syntax and adverbs<br /></strong><br />Alpha has been billed as understanding English. We all know about Jeeves and even the mixed success of putting full sentences into Google. Sometimes a cryptic phrase works better.<br /><br />There is an interesting geneological example mentioned above. You can start by typing in "father's sister". Alpha will display a graph of a geneological tree. Then you can add an apparently infinite number of family relations onto this simple query and each time Alpha will display a gradually more complicated tree. This is great and a pefect example of a computed result from sociological data.<br /><br />The issue is that if you type this "father's mother's sister' son's aunt" rather than this "father's mother's sister's son's aunt", Alpha is utterly stupid to provide any assistance, either towards the answer or even what is wrong with your question. If you crawl through these 2 strings like programmers do all day, you will see that the possessive is missing from the 3rd relation.<br /><br />This is 2 distinct, but related problems. One is grammar. I called it an adverb, but it is really just a possessive noun. The other problem is just a simple syntax problem. Even the meaning is clear in the broken case, but the syntax issue "defies" Alpha. Problems like this are rampant in all current command-line software like Mathematica, Matlab and many others.<br /><br /><strong>Drawbacks<br /></strong><br />Many of these drawbacks are similar to those with Mathematica V7.<br /><br /><em>how to know how much is there</em>? - I have not found an easy way to dump all the enities for any given subject. Sometimes, Vitamin A works and Vitamin b does not?!? I want to tell what is the range of valid inputs for this.</p><p><em>how to know what properties exists for which data</em>? - Similarly there appears to be no way easily to find out the possible properties for an entity. In V7 Mathematica, this is simple. Also if there was a syntax to pickup the property, it would help the last drawback mentioned here.</p><p><em>how to deal with syntax issues?</em> - I guess this goes to the heart of the NKS piece. I am sure there are many issues like those described above which cannot be as easily solved (or understood).</p><p><em>how to deal with semantics?</em> (hurricane delores and hurricane sally) - I found the first query in the example text. Alpha thought the second query was comparing two movies. Of course, there is no "memory" across queries.</p><p><em>how to "pipeline" results?</em> - Of course the intent would be to take a property of an entity, modify it, then use it as input to another function, then compare it to another suitably modified proerty. I cannot see a syntax to do this in the current version.<br /></p><p><br /><strong>Any meaningful use?<br /></strong><br />Methinks. In fact, there are many more non-sensically structured relevant questions that are not out on the web, that we need to figure out. This is in contrast to find something that someone else already wrote, putting your own branding at the top and selling it someone.</p><p>Alpha has many issues and significant drawbacks, but I believe that it is the closest so far to these hard-to-reach answers.<br /><br />Regards..<br /><br />Roger Williams<br />Franklin Laboratory </p>Congruent Lighthttp://www.blogger.com/profile/10982995395745927023noreply@blogger.com0tag:blogger.com,1999:blog-1792083242660765247.post-57673426029816616642009-01-04T18:55:00.000-08:002009-01-04T18:58:39.258-08:00the 300,000th Fibonacci numberI am doing some studying of computational finanacial mathematics. Part of this involves numerical approximation and performance of algorithms.<br /><br />During this quest I have stumbled upon 2 ways to very rapidly compute the Subject: number.<br />I guess I could not have imagined what this number might be.<br /><br />Now as a result of Mma, I can see this number. In scientific notation, it is:<br /><br />8.761732532916364 E 62695<br /><br />The first computation is the standard recursive definition. On my machine, this takes 1.422 seconds.<br /><br />The second computation involves nested powers of a simple 2x2 matrix with 2 column vectors equal to {0,1} and {1,1}. If this matrix is multipled by itself 300,000 times, the 2,2 element contains the number above. On my machine Mma takes 0. !?! seconds to perform this.<br /><br />Currently I do not know how to make Matlab compute this number. It just gives Inf (=Infinity?!).<br /><br />A transcipt log is stored <a href="http://files.meetup.com/1343579/bigFib.pdf">here</a>.<br /><br />Regards..<br />----------------------------<br />Originally posted 7/13/2007 at <a href="http://www.congruentialuminaire.com/cLBlog">http://www.congruentialuminaire.com/cLBlog</a>Congruent Lighthttp://www.blogger.com/profile/10982995395745927023noreply@blogger.com0tag:blogger.com,1999:blog-1792083242660765247.post-59949632704684940282009-01-02T10:08:00.000-08:002009-01-02T10:13:41.384-08:00Idiom: obtaining property values from built-in listsExample: <em>CountryData[#,"LifeExpectancy"]& /@ CountryData[]</em><br /><br />This type of idiom appears frequently in the Mma What's New pages.<br /><br />An explanation of this appears <a href="http://files.meetup.com/1343579/property%20value%20items.mht">here</a>.<br /><br />Roger Williams<br />Franklin LaboratoryCongruent Lighthttp://www.blogger.com/profile/10982995395745927023noreply@blogger.com0tag:blogger.com,1999:blog-1792083242660765247.post-49386876491105821042009-01-02T09:22:00.000-08:002009-01-02T09:24:09.122-08:00Idioms: similar to "patterns of speech" for codeThe main purpose of this category of posting is to learn often-used styles of Mma coding. I learned the majority of these by reading the code written by Maeder, Trott, Wolfram & Gray.<br /><br />Sometimes they are used for their economy. In other situations they can just be quickly recognized and even if they are not shorter, they are <em>shortcuts</em> for the reader. They are often but not always in the functional propgramming style.<br /><br />Unfortunately they mainly server this function for the <em>initiated</em>. This postings in this cateory attempt to broaden this audience.<br /><br />Roger Williams<br />Franklin LaboratoryCongruent Lighthttp://www.blogger.com/profile/10982995395745927023noreply@blogger.com0tag:blogger.com,1999:blog-1792083242660765247.post-90634649500564652862008-12-28T00:06:00.000-08:002008-12-28T00:09:50.517-08:00Comp: Factoring integers in Matlab and MathematicaProblem: Obtain factors for a very large integer, such as (2^227-1)<br /><br />Answers (from Mma):<br /><ul><li>26986333437777017</li><li>7992177738205979626491506950867720953545660121688631</li></ul><p>Mathematica V7 computes the exact factors in about 11 seconds (Mma V5 was 550 seconds) on my hardware. It has always amazed me that Mma can compute this at all.<br /></p><br />Matlab R2007A cannot perform this factorization at all. The Matlab help command explains that TMW has decided to disable [i.e. integer factorization] for numbers greater than 2^32! The Matlab doc entry does not list this restriction at all.<br /><br />Regards...<br /><br />Roger Williams<br />Franklin Laboratory<br />-----------------------------------------------------------<br />This post was originally posted on 7/15/2007 at: <a href="http://www.congruentialuminaire.com/CLBlog/default.aspx">http://www.congruentialuminaire.com/CLBlog/default.aspx</a>Congruent Lighthttp://www.blogger.com/profile/10982995395745927023noreply@blogger.com0tag:blogger.com,1999:blog-1792083242660765247.post-73173383943127267382008-12-27T23:46:00.000-08:002008-12-27T23:47:48.389-08:00Tutorial: Automatic Annotation<a href="http://files.meetup.com/1343579/BesselSolveTest3.nb">This tutorial</a> is about how to automate the annotation of a graphic created in Mma. This can be viewed with Mma Player.<br /><br />Regards...<br /><br />Roger Williams<br />Franklin LaboratoryCongruent Lighthttp://www.blogger.com/profile/10982995395745927023noreply@blogger.com0tag:blogger.com,1999:blog-1792083242660765247.post-72036304121910519662008-12-26T16:36:00.000-08:002008-12-26T16:39:01.219-08:00Correction: NDSolve plotting page contains invalid source inputOn <a href="http://reference.wolfram.com/mathematica/howto/PlotTheResultsOfNDSolve.html">this Howto page</a>, there is some clickable input listing a differential equation to be solved numerically and plotted.<br /><br />The input has been URL-encoded, so it looks like:<br /><br />ode1 = {y''[x] + Sin[y[x]] == 0, y[0] == 2, y'[0] == 1};<br /><br />Where it should contain:<br /><br />ode1 = {y''[x] + Sin[y[x]] == 0, y[0] == 2, y''[0] == 1};<br /><br />The <em>NDSolve[]</em> invocation which follows this erroneous input understandably complains. Of course it does this in an unintelligible way.<br /><br />There is more than one equation on this page with the same affliction.<br /><br />Regards..<br /><br />Roger Williams<br />Franklin LaboratoryCongruent Lighthttp://www.blogger.com/profile/10982995395745927023noreply@blogger.com0tag:blogger.com,1999:blog-1792083242660765247.post-32087677415568021342008-12-26T16:35:00.000-08:002008-12-26T16:36:40.775-08:00Correction: highlight issues where I find themI use many Wolfram Research Inc (WRI) pages that contain Mathematica (Mma) input that you can click on, copy and paste/run in the product. On a very small number of these pages there are small errors that can frustrate users.<br /><br />If I figure out the correction, I will post it here. I do not know if anyone at WRI has time to worry about these crumbs.<br /><br />Regards..<br /><br />Roger Williams<br />Franklin LaboratoryCongruent Lighthttp://www.blogger.com/profile/10982995395745927023noreply@blogger.com0tag:blogger.com,1999:blog-1792083242660765247.post-11969489945452197132008-12-26T08:46:00.000-08:002008-12-26T08:51:34.577-08:00the motivationI have just started using Mma V7. My head is exploding since I never really got caught up to the V6 version.<br /><br />I am very excited to be using this new version and it served as the motivation for this blog to help more people use this amazing piece of software.<br /><br />So the main the word that will be the common thread to this [and any good software] is: <strong><em>consistency of design</em></strong>. In software engineering this is the highest compliment and the main attribute to help the mind combat the complexity of any powerful piece of software.<br /><br />Now to the journey....Congruent Lighthttp://www.blogger.com/profile/10982995395745927023noreply@blogger.com0