<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Math-Blog &#187; Software</title>
	<atom:link href="http://math-blog.com/category/math-software/feed/" rel="self" type="application/rss+xml" />
	<link>http://math-blog.com</link>
	<description>Mathematics is wonderful!</description>
	<lastBuildDate>Fri, 23 Jul 2010 17:30:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Improve your math and programming skills with Project Euler</title>
		<link>http://math-blog.com/2009/08/19/improve-your-math-and-programming-skills-with-project-euler/</link>
		<comments>http://math-blog.com/2009/08/19/improve-your-math-and-programming-skills-with-project-euler/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 05:11:06 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Applied Math]]></category>
		<category><![CDATA[Math Websites]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://math-blog.com/?p=312</guid>
		<description><![CDATA[Project Euler can be an addictive site for people who are passionate about mathematics and programming. You don&#8217;t need to be an expert in either of these two disciplines to participate in it&#8217;s challenges, but any such skills you may already possess will be an asset. The author of the site, describes the project as [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://projecteuler.net/">Project Euler</a> can be an addictive site for people who are passionate about mathematics and programming. You don&#8217;t need to be an expert in either of these two disciplines to participate in it&#8217;s challenges, but any such skills you may already possess will be an asset.</p>
<p>The author of the site, describes the project as follows:</p>
<blockquote>
<p>Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.</p>
</blockquote>
<p>When you first register, you will be presented with 252 problems available to be solved. This number changes frequently, however, as new problems are routinely created and added to the list. The solutions to some problems veer towards the obvious, while others require advanced mathematics to tackle. Likewise, a few can be solved with paper and pencil and a good dose of insight. Most however, will require the aid of a computer program written in the language of your choice.</p>
<p align="center"><img src="http://math-blog.com/wp-content/uploads/2009/08/euler-problem.gif" alt="A Project Euler problem" title="A sample problem" /><br /><small>A sample problem (187)</small></p>
<p>Each program you execute should output your result within a minute. That&#8217;s part of the challenge, even though there is no way for the site to enforce this rule.</p>
<p>When you think you&#8217;ve found the correct result for a given problem, you can fill in the result field for the problem, and see if you got it right. If you have, your answer will be added to the list of problems you solved and will count towards your overall score, while bumping up your position on the participant scoreboards. There are several scoreboards, depending on what level you are at, which in turn is determined by the number of problems you have solved so far.</p>
<p>More importantly, solving a problem will gain you access to the respective forum (for that problem), where you&#8217;ll be able to see solutions and discussions from other participants, who may have used different languages and solution strategies.</p>
<p>Project Euler is appealing for a variety of reasons. In particular:</p>
<ul>
<li>It allows you to explore areas of math that you might not be familiar with. Solving certain problems may require you do a fair amount of research and in turn help you to learn more about certain branches of mathematics;</li>
<li>If you are a math major who is trying to hone their programming skills, you&#8217;ll find Project Euler to be challenging, fun, and an excellent opportunity for improvement. Having to implement several small programs and being able to compare your style with those of other people in the forum, will definitely end up improving your knowledge of many algorithms and your skills as a programmer;</li>
<li>The site&#8217;s one minute rule has an important consequence. The computational complexity of your programs really ends up mattering. While some simple problems can in fact be brute forced, the majority of them require you to write faster algorithms and take advantage of mathematical insight so as to improve the performance of your program. For certain problems a naive approach  would take more than a lifetime on current PCs;</li>
<li>Finally, if you are a programmer who&#8217;s scoping out a new programming language, be it Python, Ruby, Scala, Haskell or Erlang, you&#8217;ll find a great ally in Project Euler. Having to write hundreds of programs in a given language, will naturally increase your familiarity with that language. And again, comparing your newcomer coding style with those of more experience participants, will no doubt contribute to your advancement within the given language you&#8217;re focusing on.</li>
</ul>
<p>Project Euler truly deserves five stars. I recommend it highly to anyone who is unafraid of writing a few lines of code in order to solve interesting math problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://math-blog.com/2009/08/19/improve-your-math-and-programming-skills-with-project-euler/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Complex Algorithm Research and Development: Harder Than Many Think</title>
		<link>http://math-blog.com/2009/07/20/complex-algorithm-research-and-development-harder-than-many-think/</link>
		<comments>http://math-blog.com/2009/07/20/complex-algorithm-research-and-development-harder-than-many-think/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 17:57:31 +0000</pubDate>
		<dc:creator>John F. McGowan, Ph.D.</dc:creator>
				<category><![CDATA[Applied Math]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://math-blog.com/?p=193</guid>
		<description><![CDATA[An algorithm is a procedure or formula for solving a problem. For the purposes of this article, a complex algorithm is defined as an algorithm that embodies advanced mathematical or logical methods and requires at least one thousand (1000) lines of the C/C++ programming language to implement. The term C/C++ is used intentionally to reflect [...]]]></description>
			<content:encoded><![CDATA[<p>An algorithm is a procedure or formula for solving a problem. For the purposes of this article, a complex algorithm is defined as an algorithm that embodies advanced mathematical or logical methods and requires at least one thousand (1000) lines of the C/C++ programming language to implement. The term C/C++ is used intentionally to reflect the reality that object-oriented methods are of limited use in complex algorithms, although the algorithms are often packaged inside an “object” for easy integration into applications.</p>
<p>Complex algorithms are typically implemented as either computer software or in custom <span class="caps">VLSI</span> chips (e.g. Application Specific Integrated Circuits or ASICs). Research and development of complex algorithms is a specialized area and differs in a number of ways from most software and hardware development. Remarkably, many computer software business and engineering professionals often underestimate or do not understand the difficulties and scope of complex algorithm projects.</p>
<p>Complex algorithms are already in widespread use in commercial applications. Prominent examples include the video compression algorithms that enable BluRay, <span class="caps">DVD</span> Video, YouTube, and many other modern digital video systems. The <span class="caps">US DVD</span> Video market is around $25 billion per year (2007). Although limited, speech recognition such as now frequently encountered in telephone help and customer service systems is another example. Other examples include encryption, seismic modeling used in oil and gas exploration, sophisticated financial models, traffic models, and many others.</p>
<p>Complex algorithms may solve a range of major problems confronting the human race including major diseases such as cancer, the need for more and cheaper energy, and so forth. Molecular modeling may enable the design of drugs or systems of drugs that can selectively target and destroy cancer cells based on the identifying characteristics of cancer cells such as chromosomal anomalies, something currently impossible. Electromagnetic modeling software may enable the successful design and fabrication of working commercial fusion power sources. These are potential trillion-dollar markets. The global annual energy market is over $1 Trillion.</p>
<p><strong>Note:</strong> Since I am a software developer, I will focus primarily on complex algorithms developed and implemented as computer software. Many of my comments apply equally well to hardware implementation. Where I have some knowledge and experience, I will make some comments on specific hardware issues.</p>
<p><strong>Complex Algorithms Are Difficult</strong></p>
<p>Complex algorithms are usually quite difficult to develop and often take longer than experience with other software projects would indicate. Although there are exceptions, complex algorithm projects usually take between four (4) months and several years. True research projects in which new mathematical or logical methods are developed are extremely unpredictable and typically take years. Most major scientific discoveries and inventions have taken at least five (5) years.</p>
<p>Complex algorithms frequently involve a tight coupling between different parts of the algorithm. All parts must work together within tight tolerances for the entire algorithm to work. This is similar to mechanical systems such as automobile engines or mechanical clocks. Indeed, implementations of complex algorithms are often referred to as “engines”, partly for this reason. Complex algorithms are often very unforgiving. Even very small errors, getting a single bit wrong, results in the implementation failing. This occurs frequently with encryption where usually every bit must be correct and video compression where even small errors often result in unacceptable “artifacts” in the decoded video. In practical terms, this means that the amount of time spent per line of working code is often significantly larger for complex algorithm projects than other software projects such as web sites, user interfaces, database reporting systems, and so forth.</p>
<p>Most commercial software projects involve at most mathematics taught in early high school (9th, 10th grade) in the US. Even advanced high school mathematics such as the solution to quadratic equations is uncommon outside of computer graphics. Complex algorithms in widespread use today typically involve mathematics that is taught in the first and second year of college at a good college or university in the US. A few complex algorithms involve more advanced mathematics. For example, the Global Positioning System (GPS) uses General Relativity, advanced undergraduate or graduate level mathematics, to determine the location and time correctly. In the future, more advanced mathematics may be needed for pattern recognition and other advanced tasks. Most commercial software developers do not have much experience with mathematical software at the level found in complex algorithms. Research and development of complex algorithms often requires a range of mathematical and logical skills that are not common.</p>
<p><strong>Return on Investment</strong></p>
<p>The return on investment for a successful complex algorithm project can be very high. Complex algorithm research and development is typically done by small teams or individuals. Small teams are the most common. Even a multi-year project, for example five years, with a ten person team (a large team) has a total cost of about $7.5 million (using a total cost per full time employee of $150K/year). A home run can solve a billion dollar or larger problem, bringing in hundreds of millions or even billions of dollars.</p>
<ul>
<li> Return = $100 M / $7.5 M = 13.3 (small home run)</li>
<li> Return = $1 B / $7.5 M = 133 (big home run)</li>
<li> Return = $1 T / $7.5 M = 133,000 (off the charts)</li>
</ul>
<p>The greatest opportunities and the greatest risks lie in areas that require development of new mathematical or logical methods; that is true research. New complex algorithms can be converted very rapidly to commercial software products, even in a matter of months, as happened with new video compression algorithms in 2003.</p>
<p><strong>Research and Development</strong></p>
<p>The commercial software industry focuses overwhelmingly on “technically feasible” projects. Many venture capital firms explicitly claim to only invest in proven, technically feasible projects. Similar thinking pervades the commercial software industry. Where complex algorithms are concerned, technically feasible means proven algorithms for which working prototypes exist somewhere. The working prototypes are usually computer programs, often slow, that successfully implement the algorithm. These are frequently prototypes in the C or C++ programming languages, although Java is becoming more common (see the discussion of software engineering below). Thus, most commercial projects in the complex algorithms arena involve such tasks as porting algorithms to a different platform (for example, Unix to Windows), optimizing the algorithms for a new platform, integrating the algorithms into an application program such as a media player, converting a prototype into a production system, and so forth. Most research scientists would call these activities “Development” and not “Research” or “Research and Development”.</p>
<p>The commercial software industry follows a widely accepted rule to avoid projects that are not technically feasible, meaning true research projects. Nonetheless, the rhetoric of the commercial software industry, both aimed at unsophisticated investors and customers is the opposite. Terms like research, science, and research and development are used routinely to describe commercial software development activities. Many companies make statements that either explicitly claim or imply that the company has a large R&#38;D group engaged in true research. Note that rhetoric aimed at sophisticated investors such as venture capitalists is often the opposite, which can be quite confusing.</p>
<p>Historically, the commercial software industry has relied heavily on government sponsored research programs such as the Defense Advanced Research Projects Agency (DARPA) and the National Aeronautics and Space Administration (NASA) for the true research in software. Many types of software and specific software products can be traced back to government sponsored research programs. Some well known examples include the Internet, originally a <span class="caps">DARPA</span> project, and the World Wide Web, which grew out of research projects at <span class="caps">CERN</span> and <span class="caps">NCSA</span>. Many other examples exist. Essentially all speech recognition software is derived from research sponsored by <span class="caps">DARPA</span>, especially projects at Carnegie-Mellon University. Nonetheless, industry rhetoric often invokes the image of private inventors in garages, the Wright brothers, and similar images of “free enterprise” and individual initiative. Typically, the putative inventor such as Tim Berners-Lee or Marc Andreessen is emphasized and the relevant government research program ignored or downplayed. Often there is little or no progress in commercial software if the relevant government research program is unable to make progress. This is most evident in pattern recognition and artificial intelligence, where progress has been very slow or non-existent.</p>
<p>Many government research programs are afflicted by a single “right way” that is pursued to the exclusion of all others. If this right way is good, then there is steady progress in the associated commercial software field. <span class="caps">DARPA</span> in particular relies upon periodic contests pitting different methods against one another. This has repeatedly resulted in a single approach that showed early promise taking over a field. A contest of this type during the 1970’s resulted in the so-called Hidden Markov Model (HMM) based speech recognition approach replacing essentially all speech recognition research on a global scale. Essentially all major speech recognition research groups, many directly funded by <span class="caps">DARPA</span>, pursue some variant of the <span class="caps">HMM</span> algorithm. Yet the performance of the <span class="caps">HMM</span> algorithm continues to be quite limited after 30+ years.</p>
<p>Most major commercial opportunities in complex algorithms require a company to fund and undertake genuine research, a difficult task that few companies understand. Artificial intelligence, speech recognition, cures for major diseases such as cancer or working fusion energy sources require substantial research.</p>
<p><strong>Evaluating Technical Feasibility</strong></p>
<p>In complex algorithms, technical feasibility generally means that a working prototype of the complex algorithm exists. In practice, working prototypes are often implemented in computer programming languages such as <span class="caps">ANSI C</span>, C++, or Java. Special algorithm research and development tools such as Matlab and Mathematica are also used. The working prototype may be slow, inefficient, or have other limitations, but it is or should be a proof of concept.</p>
<p>Seemingly, it should be easy to evaluate technical feasibility. Simply acquire and test the working prototype. Nonetheless, there is a long history of ostensibly sophisticated organizations and investors investing in complex algorithm projects that are not technically feasible, often apparently in the belief that the relevant problem had been solved. This has happened repeatedly with pattern recognition and artificial intelligence. It has also happened with various data compression algorithms.</p>
<p>For some reason, some organizations and investors do not even acquire and test the working prototypes. This is absolutely essential. It is often said that one should invest in people, not in ideas. Venture capitalists and other sophisticated investors often quote this platitude. However, the history of complex algorithms is filled with companies and projects with officers, directors, managers, chief scientists, and so forth with gold-plated resumes, impressive credentials, top degrees from top universities, and so forth that have flopped. The bottom line in complex algorithms is that the ideas count. If the complex algorithm doesn’t work, it doesn’t work. The company or project will fail for purely technical reasons. This is the lesson, for example, of the Pen Computing fad of the early 1990’s, GO, and Lernout and Hauspie (see below). This is also one of the lessons of the complex financial models involved in the current global financial crisis (2008). Due diligence requires a thorough, well-considered independent test and evaluation of the working prototype.</p>
<p>It can be difficult to evaluate technology demonstrations of complex algorithms. Often there are subtle and not so subtle ways to manipulate a technology demonstration. For example, in the early days (1995) of <span class="caps">MPEG</span> digital video on personal computers, <span class="caps">MPEG</span> software video player companies gave technology demonstrations on high-end personal computers with high-end video acceleration graphics cards. In pattern recognition, many present-day (2008) pattern recognition algorithms can achieve recognition rates in the range of 80-95% at least under certain controlled conditions. This seems high. In schools, 80-95% is usually a B or an A, a good grade. However, practical real-world pattern recognition often requires a recognition rate of 98 or 99% or even better under field conditions. In both examples, the technology demonstration can be misleading without demonstrably false statements.</p>
<p>Actual fraud can be difficult to detect and difficult to prove. It is important to conduct tests and evaluations of working prototypes independent of the purveyor or other interested parties who may have a reason to perpetrate a fraud. Complex algorithms can involve the potential for very large returns on investment&#8212;as noted above. Consequently, there is considerable motivation for fraud in some cases.</p>
<p><strong>How Does Research Differ from Development?</strong></p>
<p>Commercial software development is usually unpredictable. Software projects frequently involve unexpected problems and usually take substantially longer than planned. Nonetheless, technically feasible commercial software development projects are more predictable than true research projects. Often if one takes a conservative cost and schedule estimate and multiplies this by a factor of three to four, one gets the actual cost and schedule of the project. A common joke with a great deal of truth is: to get the real schedule multiply the official schedule by PI (3.14) for running around in a circle. Because the project is technically feasible it can certainly be completed. Massive cost and schedule overruns (such as factors of ten) can usually be explained by incompetence or severe political problems. True research is extremely unpredictable. Many true research projects simply fail. The researchers are unable to find the solution. For example, to date (2008), essentially all attempts to decipher human speech have failed in close to a century of attempts. Substantial research efforts at Bell Labs, <span class="caps">MIT</span>, and other institutions have failed to determine why certain sound spectra correspond to the different sounds in English and other languages. Even in successful research, estimates are often way off. For example, the mathematician Johannes Kepler made a bet in 1600 that he could determine the orbit of Mars in eight (8) days. His discovery of the elliptical orbit of Mars and other planets, one of the most important and difficult discoveries in scientific history, took five frustrating years in which every attempt to solve the problem failed until he found the answer in just a few days in 1605. This process in which long periods of little or no progress are punctuated by sudden unpredictable leaps forward is typical of true research, especially major scientific discoveries or technological inventions.</p>
<p>True research, especially major scientific discoveries or inventions, usually involves a very large amount of trial and error. Often, after many failures, there is a leap or leaps in which a new approach or concept is tried which unexpectedly solves the problem. Most major scientific discoveries or inventions took somewhere between five (5) and twenty (20) years. This is significantly longer than the time frame of typical commercial software industry and venture capital funded projects. In many cases, one is talking about five to twenty years of failure followed by a “breakthrough”, as in Kepler’s case.</p>
<p>In my experience, people involved in commercial software development are often unaware that they have little or no experience with true research. The misleading rhetoric of the computer software industry often leads people involved in commercial software development to think that they are engaged in the sort of true research conjured up by iconic names like Einstein or the Wright brothers. This undoubtedly leads to many bad decisions and frustrating experiences.</p>
<p><strong>The Importance of Rapid Prototyping</strong></p>
<p>History records many remarkable instances when an individual or small team succeeded in making a major scientific discovery or invention on a very small budget, sometimes beating far better funded competitors. Major scientific discoveries or inventions almost always involve a large amount of trial and error. Discoverers or inventors who managed to make a major discovery or invention on a shoe-string budget usually found a very fast, inexpensive way to perform the many trials and errors required to make a major discovery or invention.</p>
<p>For example, James Watt is remembered for inventing the separate condenser steam engine, a major conceptual leap that turned the steam engine from a niche device used in coal mining to a major driver of the industrial revolution. The Newcomen steam engines of Watt’s time were huge expensive house-sized engines. Watt however built and experimented with tiny scale models built from inexpensive wood, copper, and other materials. This enabled him to perform hundreds of trials and errors that led to the breakthrough concept of the separate condenser that radically improved the Newcomen steam engine.</p>
<p>Octave Chanute and the Wright brothers, his proteges, conducted research and development of gliders constructed of cheap wood and canvas. The gliders were flown at low altitude on soft sand beaches, first in Gary, Indiana near Chicago where Chanute lived, and later at Kitty Hawk in North Carolina. This meant that the inevitable damage from crashes was limited and easily repaired. The pilots did not die from the crashes as was common with other early would-be aviators. By delaying work on the expensive engines until last (they planned to buy a commercial off-the-shelf engine), they avoided the enormous cost involved in repairing or replacing an engine after each crash. This enabled Chanute and the Wright brothers to eventually succeed where better funded efforts such as Hiram Maxim and Samuel Langley failed.</p>
<p>Progress in aviation and rocketry today is quite slow, almost flat-lined since 1970, in part because the cost of a single trial, especially a new high performance engine, has become extremely high, easily in the millions if not billions of dollars per prototype engine and vehicle. In rocketry and other high performance engines, the prototype engine and vehicle are often destroyed during each trial. Internet entrepreneur Elon Musk of PayPal fame encountered this problem with his SpaceX startup as have many other Internet and software entrepreneurs attracted by the dream of space travel.</p>
<p>In algorithm research and development today, rapid prototyping tools such as Matlab and Mathematica (see below) speed up and reduce the cost of the many trials and errors required in true research. This is very important because the number of trials and errors is usually very large.</p>
<p><strong>The Importance of Conceptual Analysis</strong></p>
<p>Most major scientific discoveries and inventions usually involve a large amount of conceptual analysis expressed in words and pictures (often hundreds of thousands of words). It is common to find lengthy verbal discussions of the issues combined with rough sketches or drawings of concepts. For example, Octave Chanute wrote an entire book Progress in Flying Machines containing his lengthy verbal analysis of the problem of flight. This book outlines his successful research plan to develop working powered flight. It contains several rough drawings, as is common in major breakthroughs, and only a few brief calculations. The mathematician Johannes Kepler devoted much of his book, now known as New Astronomy, to a lengthy conceptual analysis of the problem of planetary orbits which was critical to his resolution of the problem.</p>
<p>At some point, these verbal analyses are refined into precise technical drawings in the case of mechanical inventions and specific mathematical expressions in the case of mathematical discoveries like Kepler’s. However, the verbal and visual analysis appears to be critical in many discoveries and inventions and usually comes first. It is likely that this sort of verbal and visual analysis will be essential to solve many problems such as artificial intelligence and pattern recognition.</p>
<p>Historically, this conceptual analysis was considered a part of philosophy. Much of the classical training in Greek philosophy and mathematics probably provided important training in this conceptual analysis. The discovery of new mathematical expressions of practical use strictly by the symbolic manipulation and the highly abstract thought favored by the famous mathematician David Hilbert and his school at the University of Gottingen in the early 20th century seems to be rare. This is specifically mentioned because Hilbert’s extremely abstract approach to higher mathematics has come to dominate mathematics and theoretical physics in the 20th century.</p>
<p><strong>Some Famous Flops</strong></p>
<p>Complex algorithm research and development is a treacherous area. There have been numerous flops and fiascoes over the years. It is easy to misjudge the technical feasibility of projects. There is a long history of exaggerated claims for complex algorithms that emulate aspects of human intelligence such as speech recognition. There has been enormous success in data compression over the last few decades. Nonetheless, there is a long history of exaggerated claims for advanced in data compression. Video and other data compression involves complex algorithms that are difficult to evaluate. <em>Caveat emptor!</em></p>
<p>The Pen computing fad of the early 1990’s is an example of a famous flop. The most prominent of these firms was Jerry Kaplan’s GO, described in his book Startup. GO and similar firms’ business plans hinged on handwriting recognition, an unsolved problem in pattern recognition. Kaplan actually devotes only a few pages of his book to the handwriting recognition problem.</p>
<p>Another notorious example is the speech recognition firm Lernout and Hauspie. Lernout and Hauspie collapsed in a major financial scandal with court cases and allegations of massive fraud. Again, the success of Lernout and Hauspie’s business depended on the solution of the speech recognition problem, which remains largely unsolved even today.</p>
<p>Note that many apparently sophisticated investors invested many millions of dollars in both GO and Lernout and Hauspie, even though a modicum of research would have revealed the poor state of handwriting and speech recognition technology at the time.</p>
<p><strong>Some Famous Successes</strong></p>
<p>Video and audio compression is one of the most successful areas in complex algorithms. Technologies such as VideoCD, <span class="caps">DVD</span>, MP3, and BluRay all incorporate sophisticated audio and video compression algorithms.</p>
<p>A major breakthrough in video compression reached the market in 2003, embodied in H.264, Windows Media 10, Flash Video, and other video standards and products. Prior to 2003 the bitrate for usable, loosely <span class="caps">VHS</span> quality video was about one (1) megabit per second. In 2003, the new video technologies achieved a bit rate of around 275 Kilobits/second, often with close to <span class="caps">DVD</span> quality with proper tuning of the compression. This was a truly major advance, a rare technological leap forward. This enabled YouTube and other forms of Internet/web video over <span class="caps">DSL</span> connections.</p>
<p>The bottom line is that complex algorithm research and development can be done, but it is difficult.</p>
<p><strong>Software Engineering</strong></p>
<p>There are significant differences between software engineering for complex algorithm research and development and mainstream software development. As mentioned above, complex algorithms often involve a tight coupling between parts of the algorithm that makes development more difficult and tedious than most software development.</p>
<p>It is often easier to research and develop complex algorithms using tools such as Matlab, Mathematica, <span class="caps">AXIOM</span>, or Maxima (formerly known as <span class="caps">MACSYMA</span>). These are scripting languages similar to Python or <span class="caps">PHP</span>. They usually have implicit variable declaration and/or conversion. They are usually “weakly typed” languages and break many textbook rules of “good” software engineering. They include comprehensive, well-integrated libraries of mathematical, numerical, and statistical functions. They usually have a data type known variously as a list, vector, or matrix that represents sequences of numerical or symbolic data in a flexible way. These tools are sometimes referred to as computer algebra systems (CAS), although this is really only one subset of their features.</p>
<p><strong>Adding Two Vectors in Mathematica</strong></p>
<pre  class="mathcode">A = {1.0, 2.0, 3.0}; (* A is a Mathematica list *)
B = {1.1, 0.0, 4.0};
C = A + B
Out[1]={2.1, 2.0, 7.0}</pre>
<p><strong>Adding Two Vectors in C/C++</strong></p>
<pre  class="mathcode">#include &lt;iostream.h&gt;
double A[3] = {1.0, 2.0, 3.0}; // A is a C++ array
double B[3] = {1.1, 0.0, 4.0};
double C[3];
int index;

for(index = 0; index &lt;3; index++)
   C[index] = A[index] + B[index];

cout &lt;&lt; “{“ &lt;&lt; C[1] &lt;&lt; “,” &lt;&lt;
C[2] &lt;&lt; “,” &lt;&lt; C[3] &lt;&lt; “}” &lt;&lt;
endl;</pre>
<p>Note that there is a vector class template in the C++ Standard Template Library (STL) with somewhat similar properties to the lists in Mathematica. The above comparison is for illustrative purposes. Even using the <span class="caps">STL</span> classes, it is usually much easier to research, develop, and test algorithms in these tools than using traditional compiled, strongly typed languages such as C/C++, Java, or &lt;insert your favorite programming language here&gt;. However, these tools are slow and require large amounts of memory. This is a significant drawback. Once an algorithm is developed, it is often necessary to convert the algorithm to a fast compiled language for performance reasons. This is easier if the target fast language has good libraries of mathematical, numerical, and statistical functions.</p>
<p>One can also research and develop algorithms directly in a fast programming language such as C/C++ or Java. This avoids conversion costs, speed, and memory issues. However, it is often much easier to do research and development using a tool such as Matlab or Mathematica.</p>
<p>The leading algorithm research and development tools are:</p>
<ul>
<li><strong><span class="caps">MATLAB</span></strong>: <a href="http://www.mathworks.com/">Matlab</a> is widely used in the commercial world, especially in digital signal processing.</li>
<li><strong><span class="caps">MATHEMATICA</span></strong>: <a href="http://www.wolfram.com">Mathematica</a> is widely used in government sponsored research and development and academic research. It has a following in Wall Street finance and economics.</li>
<li><strong><span class="caps">AXIOM</span></strong>: <a href="http://www.axiom-developer.org">Axiom</a> is free, open source, with a Berkeley style license. <span class="caps">AXIOM</span> was started in 1971 and has over 300 man years of work integrated into it.</li>
<li><strong><span class="caps">MAXIMA</span></strong>: <a href="http://maxima.sourceforge.net">Maxima</a> is free, open-source, with a <span class="caps">GNU</span> license.</li>
</ul>
<p>Many fast programming languages have been used for complex algorithms. The most popular are probably:</p>
<ul>
<li><strong><span class="caps">ANSI C</span></strong>: <span class="caps">ANSI C</span> is almost universally available for all processors. It is simple, efficient, with small memory needs and high speed. </li>
<li><strong>C++</strong>: C++ is object-oriented. It often has larger memory needs than C and can be slower. </li>
<li><strong>Java</strong>: Java is compiled to byte-codes, but is approaching C/C++ in speed. It can be slower and less efficient. It can be easier to reverse engineer.</li>
</ul>
<p>The dream algorithm R&#38;D tool would be similar to Matlab or Mathematica but could be compiled to fast, efficient binaries similar to <span class="caps">ANSI C</span> and would be available for all platforms. An integrated <span class="caps">GUI</span> builder similar to Visual Basic and integrated network support would be helpful. The biggest single weakness of all kinds of scripting languages is that they are slow and cannot be compiled. For compute- intensive complex algorithms this can be a very significant problem. Of scripting languages, only Visual Basic 6 appears to have solved the problem of producing a compiler that can produce binary executables with similar performance to C/C++.</p>
<p>These algorithm research and development tools are not, of course, a substitute for thought, creativity, and the extensive conceptual analysis frequently required for major advances. Trial and error alone, without insight, rarely succeeds.</p>
<p><strong>Conclusion</strong></p>
<p>Complex algorithm research and development can be done successfully. Some great successes exist. Nonetheless, it is not easy and many things can go wrong. The project scope is significant. Project feasibility is difficult to assess. Genuine breakthroughs are unpredictable and take time. The return on investment for a home run can be five to thousands of times the original investment. There are great unrealized opportunities, most of which require genuine research.</p>
<p><strong>About the Author</strong></p>
<p>John F. McGowan, Ph.D. is a software developer, research scientist, and consultant. He works primarily in the area of complex algorithms that embody advanced mathematical and logical concepts, including speech recognition and video compression technologies. He has many years of experience developing software in Visual Basic, C++, and many other programming languages and environments. He has a Ph.D. in Physics from the University of Illinois at Urbana-Champaign and a B.S.in Physics from the California Institute of Technology (Caltech). He can be reached at jmcgowan11 (at) earthlink.net.</p>
<p><strong>References</strong></p>
<p><strong>Some Complex Algorithms</strong></p>
<ul>
<li><span class="caps">MPEG</span> compression, one of the great success stories: <a href="http://www.chiariglione.org/mpeg/">http://www.chiariglione.org/mpeg/</a></li>
<li>x264 is a free, opensource h.264 video encoder: <a href="http://www.videolan.org/developers/x264.html">http://www.videolan.org/developers/x264.html</a></li>
<li>The Carnegie Mellon Sphinx Project, an open-source speech recognition engine: <a href="http://cmusphinx.sourceforge.net">http://cmusphinx.sourceforge.net</a></li>
<li>National Library of Medicine Insight Image Registration and Segmentation Toolkit: <a href="http://www.itk.org">http://www.itk.org</a></li>
</ul>
<p><strong>Books and Articles</strong></p>
<ol>
<li><a href="http://www.amazon.com/gp/product/0140257314?ie=UTF8&amp;tag=antoniocangia-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0140257314">Startup: A Silicon Valley Adventure</a>, by Jerry Kaplan, Houghton Mifflin Co, Boston, 1995, ISBN 0-140-25731-4</li>
<li>“<a href="http://www.tomcoyner.com/how_high.htm">How High-Tech Dream Shattered in Scandal at Lernout &#38; Hauspie</a>”, by Mark Maremont, Jesse Eisinger, and John Carreyrou, Wall Street Journal, December 7, 2000</li>
<li>New Astronomy (Nova Astronomia), by Johannes Kepler, Translated from the Latin original by William H. Donahue, Cambridge University Press, Cambridge, UK, 1992, ISBN 0-521-30131-9</li>
</ol>
<p><em>This article was written by John F. McGowan, PhD. If you’d like to write for Math-Blog.com, please email us at submissions (at) math-blog.com.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://math-blog.com/2009/07/20/complex-algorithm-research-and-development-harder-than-many-think/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>An almost convincing start for Wolfram Alpha</title>
		<link>http://math-blog.com/2009/05/18/an-almost-convincing-start-for-wolfram-alpha/</link>
		<comments>http://math-blog.com/2009/05/18/an-almost-convincing-start-for-wolfram-alpha/#comments</comments>
		<pubDate>Mon, 18 May 2009 05:54:58 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Math News]]></category>
		<category><![CDATA[Math Websites]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://math-blog.com/?p=183</guid>
		<description><![CDATA[Wolfram Research finally launched Wolfram&#124;Alpha, the much talked about &#8220;computational knowledge engine&#8221;. It&#8217;s unusual description is justified by the fact that we are not dealing with a search engine in the classic sense of the term, nor with the next Google. At first glance we&#8217;re peering at a service that is able to provide objective [...]]]></description>
			<content:encoded><![CDATA[<p>Wolfram Research finally launched <a href="http://wolframalpha.com/">Wolfram|Alpha</a>, the much talked about &#8220;computational knowledge engine&#8221;. It&#8217;s unusual description is justified by the fact that we are not dealing with a search engine in the classic sense of the term, nor with the next Google.</p>
<p>At first glance we&#8217;re peering at a service that is able to provide objective information about a wide subset of human knowledge. But the idea behind Wolfram|Alpha is much more ambitious, as demonstrated by the <a href="http://www.wolframalpha.com/screencast/introducingwolframalpha.html">first screencast</a> to have been released (narrated by Stephen Wolfram).</p>
<div align="center"><img src="http://stacktrace.it/site_media/luambo/uploads/2009/05/17/wolfram-alpha.jpg" alt="Wolfram Alpha" title="Wolfram|Alpha" /></div>
<p>Taking advantage of the popular and powerful mathematical software Wolfram Mathematica, this new engine is able to perform calculations on information requested by its users. Therefore there are three components at work: the ability to correctly interpret queries (in English) from the users, the ability to elaborate on the data source so as to reply with coherent results to somewhat complex questions, and finally the not-so-simple task of maintaining an up-to-date and accurate knowledge base for a very wide spectrum of human knowledge.</p>
<p>This is the theory behind &#8211; or at least the ultimate aim of &#8211; the service. And as such, unlike what has been reported elsewhere, Wolfram|Alpha should immediately be viewed as an addition to what Google already offers (not as a replacement for it).</p>
<p>As expected, the service is extremely good at mathematical calculations. In this case the only limit is the timeout imposed on each query to exclude those that require far too many resources to complete. An example of a calculation that is executed is &#8220;<a href="http://www.wolframalpha.com/input/?i=integrate+e^-x^2">integrate e^-x^2</a>”.</p>
<p>For the record, this service is currently under a fair bit of stress because of the initial curiosity of many worldwide, therefore the calculation of the integral above has shown an error message a couple of times (a tribute to <a href="http://en.wikipedia.org/wiki/HAL_9000">HAL 9000</a>):</p>
<div align="center"><img src="http://stacktrace.it/site_media/luambo/uploads/2009/05/17/HAL9000.jpg" alt="Wolfram Alpha's error message" /></div>
<p>All sorts of disciplines are represented by <a href="http://www.wolframalpha.com/examples/">the examples on the site</a>, with a particular focus on scientific and engineering ones. The results are elegantly presented and well organized, often illustrated and shown in table form, particularly when the user is asking for a comparison between different data sets. There are also fun tributes, including those to <a href="http://www.wolframalpha.com/input/?i=speed+unladen+swallow">Monty Python</a> and <a href="http://www.wolframalpha.com/input/?i=the+meaning+of+life">Douglas Adams</a>. But how well does this system work when we step outside of the predefined examples provided by Stephen Wolfram&#8217;s team? The results range from exceptionally good to downright disappointing. Let&#8217;s see a few examples.</p>
<p>Let&#8217;s compare IBM, Google and Sun. As you can see, <a href="http://www.wolframalpha.com/input/?i=IBM+Google+Sun">the results</a> are definitely excellent. The comparison is almost exclusively numeric in nature, but the answer provided by WA jives with what I was hoping for. The same is true if you look for statistical information on a single large company like <a href="http://www.wolframalpha.com/input/?i=Telecom+Italia">Telecom Italia</a>.</p>
<p>Since this is a &#8220;computational engine&#8221; we can even try to perform a few calculations starting with the data that we found to be available in the comparison tables for the companies above. For example, &#8220;<a href="http://www.wolframalpha.com/input/?i=employees+IBM%2FGoogle">employees IBM/Google</a>&#8221; will show us the ratio over the last few years between the number of IBM and Google employees (IBM currently hires almost 20 times as many people). We can calculate the revenue for each IBM employee by running &#8220;<a href="http://www.wolframalpha.com/input/?i=(market+cap+%2F+employees+IBM)">(market cap / employees IBM)</a>”, but the engine fails to compare this parameter between companies: &#8220;<a href="http://www.wolframalpha.com/input/?i=(market+cap+%2F+employees+IBM)+%2F+(market+cap+%2F+employees+Google)">(market cap / employees IBM) / (market cap / employees Google)</a>”, despite the fact that the data for such a calculation is all there in the knowledge base (and as you can see there was already a revenue/employee row in the initial comparison table).</p>
<p>Moving on to something else, we can try to compare two cities like Toronto and Milan, and obtain <a href="http://www.wolframalpha.com/input/?i=toronto+milan">very useful details</a>. It&#8217;s also possible to calculate only certain attributes by running, for example, &#8220;<a href="http://www.wolframalpha.com/input/?i=population+Toronto%2FMilan">population Toronto/Milan</a>&#8221; or &#8220;<a href="http://www.wolframalpha.com/input/?i=distance+toronto+milan">distance Toronto Milan</a>”. In the first case the data was updated to 2004, and is perhaps a little outdated now despite the fact that we are talking about demographic data. But the real problem arises when we try to compare the regions of Ontario and Lombardy. We&#8217;d expect to see nice geographical, demographical and economical comparisons between the two, yet instead we get <a href="http://www.wolframalpha.com/input/?i=ontario+lombardy">nothing</a>. Wolfram|Alpha will report information about little towns like <a href="http://www.wolframalpha.com/input/?i=unionville">Unionville (NC)</a>, but totally ignores a region like Lombardy or a Canadian province like Ontario (with a population of 13 million people). It would seem that this is a big hole in the knowledge of this service. Sure it&#8217;s fairly easy to fix, but it&#8217;s a symptomatic weakness nevertheless.</p>
<p>If we consider for a moment searches about famous people, we&#8217;ll find an excess of zealousness in trying to be concise and objective. In fact, when searching for <a href="http://www.wolframalpha.com/input/?i=Barack+Obama">Barack Obama</a>, the results are limited to his place and date of birth, and stating that he is a head of state. We may be spoiled by Wikipedia, but a photo or a few more details at least were to be expected. For example, at a bare minimum, it could be indicated that we are reading the page of the 44th President of the United States of America. But Wolfram|Alpha reserves this type of treatment for all famous people, including Stephen Wolfram himself.</p>
<p>In the comparison between &#8220;<a href="http://www.wolframalpha.com/input/?i=Paul+Erdos+vs+Euler">Paul Erdos vs Euler</a>&#8221; one would expect a nice parallel between these two great, prolific mathematicians (for example, you might expect comparisons on the number of publications, total number of pages, the most significant discoveries, and so on). Instead, the results are limited to a comparison of births and deaths. This is quite disappointing no matter how you look at it. On a side note however, it must be said that WA is quite good at interpreting misspelled names (e.g., Paul Erddsos).</p>
<p>The Natural Language Processing (NLP) capabilities of Wolfram|Alpha are good enough to use the service without encountering any major frustrations, but it doesn&#8217;t appear to be a particular revolution or advancement in the field of artificial intelligence either. It is also clear that we are not dealing with a Google-killer nor a Wikipedia-killer, but rather with an innovative new tool that can be used in addition to the existing ones. That said, elsewhere I mentioned that I personally think that this is a step forward for humanity. It may be a small step, but I stand behind that bold statement.</p>
<p>We are at the forefront of a service that will be useful for research and to anyone with a need for correct data as quickly as possible. The knowledge base will have to grow, some data will have to be updated, and the engine will need to permit more freedom in the kind of calculations that are allowed to be performed. There can be little doubt thought that we are witnesses to the birth of something ambitious that has the potential to accelerate the advancement of our civilization.</p>
<p><em>An Italian translation of this article is <a href="http://stacktrace.it/2009/05/un-avvio-convincente-per-wolfram-alpha/">available on Stacktrace.it</a>.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://math-blog.com/2009/05/18/an-almost-convincing-start-for-wolfram-alpha/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>A New Kind of Search</title>
		<link>http://math-blog.com/2009/03/10/a-new-kind-of-search/</link>
		<comments>http://math-blog.com/2009/03/10/a-new-kind-of-search/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 20:29:32 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Applied Math]]></category>
		<category><![CDATA[Math News]]></category>
		<category><![CDATA[Math Websites]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://math-blog.com/?p=172</guid>
		<description><![CDATA[Seven years ago Stephen Wolfram published A New Kind of Science. I remember the hype surrounding this book. Journalists jumped at the chance to praise a heavy tome that was too complex for most of them to fully understand, but that shipped with an ambitious title and the implicit guarantee that comes from a genius [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.com/gp/product/1579550088?ie=UTF8&#038;tag=antoniocangia-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=1579550088"><img src="http://math-blog.com/images/nks.jpg" alt="A New Kind of Science" align="right" /></a>Seven years ago Stephen Wolfram published <a href="http://www.amazon.com/gp/product/1579550088?ie=UTF8&#038;tag=antoniocangia-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=1579550088">A New Kind of Science</a>. I remember the hype surrounding this book. Journalists jumped at the chance to praise a heavy tome that was too complex for most of them to fully understand, but that shipped with an ambitious title and the implicit guarantee that comes from a genius like <a href="http://en.wikipedia.org/wiki/Stephen_Wolfram">Wolfram</a>.</p>
<p>It was &#8220;buzz worthy&#8221; for sure, and all the attention quickly attracted the interest of numerous scientists from many disciplines. As soon as the mathematicians, and particularly computer scientists, managed to get through its 1000+ pages, the first negative reviews began to pour in. Though, in all fairness, a few scientists had a little too much fun with this book and managed to showcase their comedic abilities by writing <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2Freview%2FR6B8KO2M32P8G%3Fie%3DUTF8%26ref%255F%3Dcm%255Fcr%255Frdp%255Fperm&#038;tag=antoniocangia-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=390957">some of the most hilarious reviews</a> known to humankind.</p>
<p>In this controversial best-seller, Stephen Wolfram primarily dissects the subject of cellular automata and its relevance to other scientific disciplines, in a systematic manner. It&#8217;s a book that covers a lot of ground and is arguably a remarkable piece of writing. Yet, the scientific community greeted the book with a fair dose of criticism.</p>
<p>So what went wrong? The main problem with <em>A New Kind of Science</em> is that it set very high expectations due to its author, title, and the numerous reminders of how important this material is, throughout the book.</p>
<p>The main accusations ranged from the book being called a display of Wolfram&#8217;s ego, to having very little &#8220;new&#8221; content, all the way to the more severe claims of not crediting other people&#8217;s work. For example, the idea of the universe as a cellular automaton was first presented by Konrad Zuse, so Wolfram&#8217;s &#8220;new&#8221; idea of a discrete, computable universe was anything but groundbreaking. On top of that, the most remarkable technical achievement revealed in this book was arguably the proof that the rule 110 cellular automaton is Turing complete. While this was conjectured by Wolfram, it was actually proven by his assistant Matthew Cook, who was refrained from publishing his results elsewhere by Wolfram&#8217;s lawyers.</p>
<p>It&#8217;s important to understand that, while perhaps not accepted as the breakthrough that Wolfram had hoped for, this book &#8211; and the methods for studying computational systems illustrated within it &#8211; is far from gibberish. Wolfram&#8217;s ambitious project failed in the eyes of the community due to the extremely high expectations that were set for this book. When you claim to have something radically new, you must be able to back that claim up in a convincing enough manner or else you&#8217;re bound to end up with egg on your face.</p>
<p>To be fair to Wolfram (for the few who are not familiar with his work) NKS is a controversial project, but he was already famous for having created the excellent program Mathematica (whose 7th version was recently released), one of the world&#8217;s most complete and advanced mathematical software.</p>
<p>Now Wolfram is at it again. According to his <a href="http://blog.wolfram.com/2009/03/05/wolframalpha-is-coming/">recent announcement</a>, he is about to unleash something called <a href="http://www.wolframalpha.com/">WolframAlpha</a> to the world, which combines both his work with Mathematica and NKS. In Wolfram&#8217;s own words:</p>
<blockquote><p>I had two crucial ingredients: Mathematica and NKS. With Mathematica, I had a symbolic language to represent anything—as well as the algorithmic power to do any kind of computation. And with NKS, I had a paradigm for understanding how all sorts of complexity could arise from simple rules.</p></blockquote>
<p>The project has been kept on the down-low for the past few years, while some of the brightest mathematicians and engineers employed by Wolfram Research, Inc. worked on it. It&#8217;s currently in private beta, but will go live in May of this year. From an initial glance, it would seem to be just another search engine a la Google.com. But is it? Not quite. It&#8217;s labeled as a &#8220;computational knowledge engine&#8221;, whose aim is to compute answers from the human knowledge available on the web. Whereas on Google you can search for strings and the results will be a series of relevant links, WolframAlpha will supposedly be able to parse and &#8220;understand&#8221; a query that&#8217;s inputted in English, and compute an answer based on the extensive knowledge stored in its system (assuming that a univocal answer exists). Conceptually speaking, it&#8217;s leaps and bounds more complex to get right than Google, which simply looks for matching strings and orders the results based on the popularity of the given keywords (For more information about the mathematics behind Google, read <a href="http://www.amazon.com/gp/product/0691122024?ie=UTF8&#038;tag=antoniocangia-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0691122024">this book</a>).</p>
<p align="center"><img src="http://math-blog.com/images/wolframalpha.png" alt="WolframAlpha" /></p>
<p><a href="http://www.twine.com/item/122mz8lz9-4c/wolfram-alpha-is-coming-and-it-could-be-as-important-as-google">According to Nova Spivack</a>, who had a chance to try out WolframAlpha, the service is able to compute factual answers to questions such as &#8220;What is the location of Timbuktu?&#8221;, &#8220;How many protons are in a hydrogen atom?,&#8221; &#8220;What was the average rainfall in Boston last year?,&#8221; &#8220;What is the 307th digit of Pi?,&#8221; &#8220;where is the ISS?&#8221; or &#8220;When was GOOG worth more than $300?&#8221;. This project has the potential to change the world as we know it, just like Google did. Several years ago Altavista was fine for most people&#8217;s search needs &#8211; or so we thought. It took Google to show us how much better off we could be search-wise, how much we needed Google, and ultimately how inadequate Altavista was. Unlike the case of Google and Altavista though, WolframAlpha would not replace Google, since the two services cover complimentary needs. Having access to a service that&#8217;s able to compute answers out of the chaos of the factual information that&#8217;s available to man would be a major breakthrough for humanity and computer science. And if an API (Application Programming Interface) were to become available, other developers would be able to tap into that with their applications.</p>
<p>Bold claims, high expectations. You understand why, two months away from experiencing something so potentially revolutionary, there is a lot of hype surrounding this project &#8211; but also major skepticism. For many this is <em>A New Kind of Science</em> all over again, especially since natural language processing and &#8220;computing knowledge&#8221; are extremely ambitious challenges in a realm where many have failed before. Pulling this one off would be a major accomplishment (that would dwarf Wolfram&#8217;s past achievements, including Mathematica), and, at long last, it would be the hard earned, practical validation of some of the methods and philosophies expressed in NKS by Wolfram.</p>
<p>I fully expect people to find bugs and have many simple questions, for which we will see bizarre answers. We&#8217;ll read blog posts about the whole thing and perhaps have a good laugh. But what interests me the most is whether, as Google did in the past, this new engine will be able to be practical and useful on an everyday level. Bugs are fair play and expected, but what we&#8217;re looking for here is a spark of true innovation thanks to the mathematical modelling of human knowledge.</p>
<p>I suspect that this engine will either have us in awe like Mathematica did, or leave us with mixed feelings &#8211; if not downright disappointment, like <em>A New Kind of Science</em> did for many. I can&#8217;t help but hope for the former, as I wait for my chance to try it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://math-blog.com/2009/03/10/a-new-kind-of-search/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>13 Useful Math Cheat Sheets</title>
		<link>http://math-blog.com/2008/09/20/13-useful-math-cheat-sheets/</link>
		<comments>http://math-blog.com/2008/09/20/13-useful-math-cheat-sheets/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 16:42:20 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Applied Math]]></category>
		<category><![CDATA[Math Education]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://math-blog.com/?p=55</guid>
		<description><![CDATA[Cheat sheets can be very useful and make for great posters around your room. The following is a collection of 13 cheat sheets for several mathematical topics and programs: General Math Cheat Sheet (iPaper and other formats) Elementary Algebra Cheat Sheet (PDF) Trigonometry Cheat Sheet (PDF) Calculus Cheat Sheet (PDF) Derivatives and Integrals Cheat Sheet [...]]]></description>
			<content:encoded><![CDATA[<p>Cheat sheets can be very useful and make for great posters around your room. The following is a collection of 13 cheat sheets for several mathematical topics and programs:</p>
<ol>
<li><a href="http://www.scribd.com/doc/4549/Math-cheat-sheet-by-Dr-Seiden">General Math Cheat Sheet</a> (iPaper and other formats)</li>
<li><a href="http://tutorial.math.lamar.edu/pdf/Algebra_Cheat_Sheet.pdf">Elementary Algebra Cheat Sheet</a> (PDF)</li>
<li><a href="http://tutorial.math.lamar.edu/pdf/Trig_Cheat_Sheet.pdf">Trigonometry Cheat Sheet</a> (PDF)</li>
<li><a href="http://tutorial.math.lamar.edu/pdf/Calculus_Cheat_Sheet_All.pdf">Calculus Cheat Sheet</a> (PDF)</li>
<li><a href="http://tutorial.math.lamar.edu/pdf/Common_Derivatives_Integrals.pdf">Derivatives and Integrals Cheat Sheet</a> (PDF)</li>
<li><a href="http://tutorial.math.lamar.edu/pdf/Laplace_Table.pdf">Laplace Transforms Cheat Sheet</a> (PDF)</li>
<li><a href="http://www.glump.net/content/abstract_algebra_cheat">Abstract Algebra Cheat Sheet</a> (PDF)</li>
<li><a href="http://kom.aau.dk/project/sipcom/SIPCom06/semester7/FP7-5/prob-cheat-sheet.pdf">Probability Theory Cheat Sheet</a> (PDF)</li>
<li><a href="http://web.mit.edu/18.06/www/MATLAB/matlab-cheatsheet.pdf">Matlab Cheat Sheet</a> (PDF)</li>
<li><a href="http://www.uoregon.edu/~joe/mathematica-cheat-sheet.pdf">Mathematica Cheat Sheet</a> (PDF)</li>
<li><a href="http://math.mtsac.edu/resources/maple11_cheatsheet1.pdf">Maple Cheat Sheet</a> (PDF)</li>
<li><a href="http://math-blog.com/2007/06/04/a-10-minute-tutorial-for-solving-math-problems-with-maxima/">Maxima Cheat Sheet</a> (HTML web page)</li>
<li><a href="http://stdout.org/~winston/latex/">LaTeX Cheat Sheet</a> (several formats)</li>
</ol>
<p>And since most of us like to show our math pride off when out and about as well, Amazon sells this awesome <a href="http://math-blog.com/go/?B000QHGDSU">Math Cheat Sheet T-shirt</a><img src="http://www.assoc-amazon.com/e/ir?t=antoniocangia-20&#038;l=as2&#038;o=1&#038;a=B000QHGDSU" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> with formulas on both sides (Also available for <a href="http://math-blog.com/go/?B000QHEPL2">Science</a> and <a href="http://math-blog.com/go/?B001CP5UGG">Engineering</a>). How awesome is this? <img src='http://math-blog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p align="center"><a href="http://math-blog.com/go/?B000QHGDSU"><img src="http://math-blog.com/wp-content/uploads/2008/09/math-t-shirt.jpg" alt="Math Cheat Sheet T-shirt" title="How awesome is this?" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://math-blog.com/2008/09/20/13-useful-math-cheat-sheets/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>Getting started with gnuplot</title>
		<link>http://math-blog.com/2008/06/08/getting-started-with-gnuplot/</link>
		<comments>http://math-blog.com/2008/06/08/getting-started-with-gnuplot/#comments</comments>
		<pubDate>Sun, 08 Jun 2008 14:24:02 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Applied Math]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Suggested Reading]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[gnuplot]]></category>
		<category><![CDATA[plotting]]></category>

		<guid isPermaLink="false">http://math-blog.com/2008/06/08/getting-started-with-gnuplot/</guid>
		<description><![CDATA[gnuplot is an excellent scientific package for visualizing data and plotting functions. Despite its name, it has nothing to do with the GNU project, even though it&#8217;s Open Source and entirely free. This tool is very handy whenever you need to produce production quality graphics from a given data-set (or function). It is no wonder [...]]]></description>
			<content:encoded><![CDATA[<p>gnuplot is an excellent scientific package for visualizing data and plotting functions. Despite its name, it has nothing to do with the <span class="caps">GNU</span> project, even though it&#8217;s Open Source and entirely free. This tool is very handy whenever you need to produce production quality graphics from a given data-set (or function). It is no wonder that in its 20+ years of existence, it&#8217;s been employed in all sorts of industries.</p>
<p>Flexible, powerful, and easy to use, gnuplot is not only handy as a stand-alone program but can be used successfully by a variety of programming languages, including but not limited to Ruby, Python and Perl. It has also been adopted as a plotting engine by Open Source programs like Maxima and <span class="caps">GNU</span> Octave. The minimal effort required to learn gnuplot is therefore a very worthwhile endeavor. Being able to visualize things as you analyze data and explore mathematics, is a very useful aid.</p>
<p>gnuplot is cross-platform, and you can <a href="http://sourceforge.net/project/showfiles.php?group_id=2055&#38;package_id=1996&#38;release_id=582819">download it</a> from SourceForge.</p>
<p>Once you have installed gnuplot, you can start the tool by simply running <code>gnuplot</code> from the shell. Getting started with the program is straightforward, given that the most basic functionalities are fairly intuitive. For example, if you wanted to plot the sin(x) function, you could run:</p>
<pre class="mathcode">
gnuplot&gt; plot sin(x)
</pre>
<p align="center"><img src='http://math-blog.com/wp-content/uploads/2008/06/gnuplot1.png' alt='gnuplot1.png' /></p>
<p>gnuplot will automatically decide for you what portions of the function should be visualized (in our case between -10 and 10 on the x axis). If you want to overwrite this, you can specify otherwise, as shown below:</p>
<pre class="mathcode">
gnuplot&gt; plot [-pi:pi] sin(x)
</pre>
<p align="center"><img src='http://math-blog.com/wp-content/uploads/2008/06/gnuplot2.png' alt='gnuplot2.png' /></p>
<p>Similarly, you can customize the plotting, by specifying a range on the y axis:</p>
<pre class="mathcode">
gnuplot&gt; plot [] [-0.5:0.5] sin(x)
</pre>
<p align="center"><img src='http://math-blog.com/wp-content/uploads/2008/06/gnuplot3.png' alt='gnuplot3.png' /></p>
<p>It is also possible to plot several functions at once:</p>
<pre class="mathcode">
gnuplot&gt; plot [-2:2] x, x**2, x**3
</pre>
<p align="center"><img src='http://math-blog.com/wp-content/uploads/2008/06/gnuplot4.png' alt='gnuplot4.png' /></p>
<p>gnuplot can draw all sorts of functions and graphics. For example, the following plots two surfaces:</p>
<pre class="mathcode">
gnuplot&gt; splot x**2+y**2, x**2-y**2
</pre>
<p align="center"><img src='http://math-blog.com/wp-content/uploads/2008/06/gnuplot5.png' alt='gnuplot5.png' /></p>
<p>What you see plotted above, is based on a sensible set of defaults, but gnuplot offers countless options to customize the appearance of your graphics.</p>
<p>gnuplot isn&#8217;t just useful for plotting mathematical functions. I often use it for plotting data that is stored in tabular format in simple text formats. For example, assume that you have collected the following data on Deaths by Major Causes in the US, from a website:</p>
<h3 align="center"><a href='http://math-blog.com/wp-content/uploads/2008/06/stats.txt' title='stats.txt'>stats.txt</a></h3>
<p>That&#8217;s a big chunk of data, but it&#8217;s not very easy to analyze. It&#8217;d be nice to be able to visualize it. Assuming you saved it in a <code>stats.txt</code> file (you can include or remove the first few lines of comments) from gnuplot you can run the following:</p>
<pre class="mathcode">
gnuplot&gt; plot "stats.txt"
</pre>
<p align="center"><img src='http://math-blog.com/wp-content/uploads/2008/06/gnuplot6.png' alt='gnuplot6.png' /></p>
<p>That&#8217;s a meaningless mess. But gnuplot is very flexible, so we can easily do much better. Let&#8217;s use the first column for x values, and each of the remaining columns as a curve of its own by running:</p>
<pre class="mathcode">

gnuplot&gt; plot "stats.txt" using 1:2 title "Heart disease" with lines, "stats.txt" using 1:3 title "Cancer" with lines, "stats.txt" using 1:4 title "Cerebro-vascular diseases" with lines, "stats.txt" using 1:5 title "Lower respiratory diseases" with lines, "stats.txt" using 1:6 title "Diabetes mellitus" with lines, "stats.txt" using 1:7 title "Influenza and pneumonia" with lines, "stats.txt" using 1:8 title "Chronic liver disease" with lines, "stats.txt" using 1:9 title "Accidents" with lines, "stats.txt" using 1:10 title "Suicide" with lines, "stats.txt" using 1:11 title "Homicide" with lines
</pre>
<p>Or it&#8217;s abbreviated version:</p>
<pre class="mathcode">
gnuplot&gt; plot "stats.txt" u 1:2 title "Heart disease" w l, "" u 1:3 title "Cancer" w l, "" u 1:4 title "Cerebro-vascular diseases" w l, "" u 1:5 title "Lower respiratory diseases" w l, "" u 1:6 title "Diabetes mellitus" w l, "" u 1:7 title "Influenza and pneumonia" w l, "" u 1:8 title "Chronic liver disease" w l, "" u 1:9 title "Accidents" w l, "" u 1:10 title "Suicide" w l, "" u 1:11 title "Homicide" w l
</pre>
<p align="center"><img src='http://math-blog.com/wp-content/uploads/2008/06/gnuplot7.png' alt='gnuplot7.png' /></p>
<p>Much better! Of course, the command above has a bit of repetition in it, but it&#8217;s justified by the flexibility of being able to pull data from different files if required, and plot some data with lines and others without (or in different styles) if we want to. To improve the appearance and legibility of the chart, let&#8217;s add a grid:</p>
<pre class="mathcode">
gnuplot&gt; set grid
gnuplot&gt; replot
</pre>
<p align="center"><img src='http://math-blog.com/wp-content/uploads/2008/06/gnuplot8.png' alt='gnuplot8.png' /></p>
<p>Nice! And notice how the <code>replot</code> command runs the last plotting directive for us, saving us some typing (or scrolling through the previous commands). To improve this further, we can also set the labels for the axis and a title for the whole chart:</p>
<pre class="mathcode">
gnuplot&gt; set xlabel "Years"
gnuplot&gt; set ylabel "Death rates per 100,000 people"
gnuplot&gt; set title "Deaths by Major Causes, 1960–2005"
gnuplot&gt; replot
</pre>
<p align="center"><img src='http://math-blog.com/wp-content/uploads/2008/06/gnuplot9.png' alt='gnuplot9.png' /><br/>(Click <a href='http://math-blog.com/wp-content/uploads/2008/06/gnuplot10.png' alt='gnuplot10.png'>here</a> for a larger version)</p>
<p>Effortlessly, we went from having some data in a text file, to a meaningful, and professional looking chart that could be used in an article or a book. Not bad. You can save it in your favorite format, by setting the output file name and the terminal type. In the example below, I specify the font type, size and its location on my Mac <span class="caps">OS X</span> system, but it&#8217;s entirely optional. If missing, the default fonts apply.</p>
<pre class="mathcode">
gnuplot&gt; set output "mychart.png"
gnuplot&gt; set terminal png font "/Library/Fonts/Times New Roman.ttf, 11"
gnuplot&gt; replot
</pre>
<p>This very short introduction should you give you a glimpse into what gnuplot can do for you, and even get you started with the tool. But gnuplot is much more than this and infinitely customizable, so you really may want to consider learning more about it. Unfortunately, despite being widely used for more than a decade, gnuplot has never had a book published about it.</p>
<p><a href="http://www.amazon.com/gp/product/1933988398?ie=UTF8&#38;tag=antoniocangia-20&#38;linkCode=as2&#38;camp=1789&#38;creative=9325&#38;creativeASIN=1933988398"><img src='http://math-blog.com/wp-content/uploads/2008/06/gnuplot.jpg' alt='gnuplot.jpg' align="right" /></a>Thankfully, <a href="http://www.manning.com/affiliate/idevaffiliate.php?id=980_0_3_14">Manning Publications</a> will be putting out a book called <a href="http://www.amazon.com/gp/product/1933988398?ie=UTF8&#38;tag=antoniocangia-20&#38;linkCode=as2&#38;camp=1789&#38;creative=9325&#38;creativeASIN=1933988398">Gnuplot in Action</a> in October. The good news is that you don&#8217;t have to wait for the dead tree version, you can <a href="http://manning.com/janert/">purchase it today</a> through the Manning Early Access Program (MEAP). 12 out of the 15 chapters are already available, so the book is pretty much complete. If you&#8217;re interested in making the best out of gnuplot, this book is a must have. You don&#8217;t have to be a mathematician or a programmer to follow along, and it&#8217;s so much more than a bunch of options for customizing your graphics. The book guides you through the best techniques for taking advantage of the tool in several common scenarios. By reading, this easy to follow book, you&#8217;ll be able to generate colorful, nifty plots and have good mastery of the tool in a very short amount of time.</p>
]]></content:encoded>
			<wfw:commentRss>http://math-blog.com/2008/06/08/getting-started-with-gnuplot/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>A 10 minute tutorial for solving Math problems with Maxima</title>
		<link>http://math-blog.com/2007/06/04/a-10-minute-tutorial-for-solving-math-problems-with-maxima/</link>
		<comments>http://math-blog.com/2007/06/04/a-10-minute-tutorial-for-solving-math-problems-with-maxima/#comments</comments>
		<pubDate>Mon, 04 Jun 2007 17:26:41 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Essential Math]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[calculus]]></category>
		<category><![CDATA[CAS]]></category>
		<category><![CDATA[Maxima]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://math-blog.com/2007/06/04/a-10-minute-tutorial-for-solving-math-problems-with-maxima/</guid>
		<description><![CDATA[About 50,000 people read my article 3 awesome free Math programs. Chances are that at least some of them downloaded and installed Maxima. If you are one of them but are not acquainted with CAS (Computer Algebra System) software, Maxima may appear very complicated and difficult to use, even for the resolution of simple high [...]]]></description>
			<content:encoded><![CDATA[<p>About 50,000 people read my article <a href="http://math-blog.com/2007/06/02/3-awesome-free-math-programs/">3 awesome free Math programs</a>. Chances are that at least some of them downloaded and installed Maxima. If you are one of them but are not acquainted with CAS (Computer Algebra System) software, Maxima may appear very complicated and difficult to use, even for the resolution of simple high school or calculus problems. This doesn&#8217;t have to be the case though, whether you are looking for more <a href="http://mathworld.wolfram.com/">math resources</a> to use in your career or a student in an <a href="http://diplomaguide.com/articles/Online_Bachelor_of_Science_Degree_in_Math.html">online bachelor’s degree in math</a> looking for homework help, Maxima is very friendly and this 10 minute tutorial will get you started right away. Once you&#8217;ve got the first steps down, you can always look up the specific function that you need, or learn more from Maxima&#8217;s <a href="http://maxima.sourceforge.net/docs/manual/en/maxima.html">official manual</a>. Alternatively, you can use the question mark followed by a string to obtain in-line documentation (e.g. ? integrate). This tutorial takes a practical approach, where simple examples are given to show you how to compute common tasks. Of course this is just the tip of the iceberg. Maxima is so much more than this, but scratching even just the surface should be enough to get you going. In the end you are only investing 10 minutes.</p>
<h3 style="color: #83b4d8">Maxima as a calculator</h3>
<p>You can use Maxima as a fast and reliable calculator whose precision is arbitrary within the limits of your PC&#8217;s hardware.  Maxima expects you to enter one or more commands and expressions separated by a semicolon character (;), just like you would do in many programming languages.</p>
<pre class="mathcode"><code>(%i1) 9+7;
(%o1) <img src='http://math-blog.com/wp-content/latex/pictures/c74d97b01eae257e44aa9d5bade97baf.png' title='16' alt='16' align=absmiddle>
(%i2) -17*19;
(%o2) <img src='http://math-blog.com/wp-content/latex/pictures/be66d9f23cd2674fd82c731c5e455b46.png' title='-323' alt='-323' align=absmiddle>
(%i3) 10/2;
(%o3) <img src='http://math-blog.com/wp-content/latex/pictures/e4da3b7fbbce2345d7772b0674a318d5.png' title='5' alt='5' align=absmiddle>
</code></pre>
<p>Maxima allows you to refer to the latest result through the % character, and to any previous input or output by its respective prompted %i (input) or %o (output). For example:</p>
<pre class="mathcode"><code>(%i4) % - 10;
(%o4) <img src='http://math-blog.com/wp-content/latex/pictures/47c1b025fa18ea96c33fbb6718688c0f.png' title='-5' alt='-5' align=absmiddle>
(%i5) %o1 * 3;
(%o5) <img src='http://math-blog.com/wp-content/latex/pictures/642e92efb79421734881b53e1e1b18b6.png' title='48' alt='48' align=absmiddle></code></pre>
<p>For the sake of simplicity, from now on we will omit the numbered input and output prompts produced by Maxima&#8217;s console, and indicate the output with a =&gt; sign. When the numerator and denominator are both integers, a reduced fraction or an integer value is returned. These can be evaluated in floating point by using the <em>float</em> function (or <em>bfloat</em> for big floating point numbers):</p>
<pre class="mathcode"><code>8/2;
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/a87ff679a2f3e71d9181a67b7542122c.png' title='4' alt='4' align=absmiddle>
8/2.0;
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/07078a97d66756f213dbca3e379bf084.png' title='4.0' alt='4.0' align=absmiddle>
2/6;
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/68dba25e86e6ce6d972260769f2dea8f.png' title='\displaystyle \frac{1}{3}' alt='\displaystyle \frac{1}{3}' align=absmiddle>
float(1/3);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/7378f68ee7341ae1392ab17928106e18.png' title='0.33333333333333' alt='0.33333333333333' align=absmiddle>
1/3.0;
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/7378f68ee7341ae1392ab17928106e18.png' title='0.33333333333333' alt='0.33333333333333' align=absmiddle>
26/4;
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/e8ba7d7a40ece070bb4b4918367e4a39.png' title='\displaystyle \frac{13}{2}' alt='\displaystyle \frac{13}{2}' align=absmiddle>
float(26/4);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/f884cc5c56f9c9a8d4d61568ff64db9c.png' title='6.5' alt='6.5' align=absmiddle>
</code></pre>
<p>As mentioned above, big numbers are not an issue:</p>
<pre class="mathcode"><code>13^26;
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/a9974635452a01dbbb49a66d27ae9a36.png' title='91733330193268616658399616009' alt='91733330193268616658399616009' align=absmiddle>
13.0^26
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/685ea149f902dbc31bec0be385991abd.png' title='\displaystyle 9.1733330193268623\text{ }10^_{+28}' alt='\displaystyle 9.1733330193268623\text{ }10^_{+28}' align=absmiddle>
30!;
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/3a1fa1ec8e3f642253a52f82c5fb44f9.png' title='265252859812191058636308480000000' alt='265252859812191058636308480000000' align=absmiddle>
float((7/3)^35);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/1f9afc1dcfcf374ad3a2c3bc9b31e34c.png' title='\displaystyle 7.5715969098311943\text{ }10^_{+12}' alt='\displaystyle 7.5715969098311943\text{ }10^_{+12}' align=absmiddle>
</code></pre>
<h3 style="color: #83b4d8">Constants and common functions</h3>
<p>Here is a list of common constants in Maxima, which you should be aware of:</p>
<ul>
<li>%e &#8211; Euler&#8217;s Number</li>
<li>%pi &#8211; <img src='http://math-blog.com/wp-content/latex/pictures/079d6019b766ef46daa135719f467853.png' title='\displaystyle \pi' alt='\displaystyle \pi' align=absmiddle></li>
<li>%phi &#8211; the golden mean (<img src='http://math-blog.com/wp-content/latex/pictures/84edea5047a93af2f47894da4ddb615f.png' title='\displaystyle \frac{1+\sqrt{5}}{2}' alt='\displaystyle \frac{1+\sqrt{5}}{2}' align=absmiddle>)</li>
<li>%i &#8211; the imaginary unit (<img src='http://math-blog.com/wp-content/latex/pictures/4bb0994807c45a649e806350998e2de6.png' title='\displaystyle \sqrt{-1}' alt='\displaystyle \sqrt{-1}' align=absmiddle>)</li>
<li>inf &#8211; real positive infinity (<img src='http://math-blog.com/wp-content/latex/pictures/7ed9abff4dafd78d08e616c899412e92.png' title='\infty' alt='\infty' align=absmiddle>)</li>
<li>minf &#8211; real minus infinity (<img src='http://math-blog.com/wp-content/latex/pictures/aad18c0a88969b4c1bdc3711475796c2.png' title='-\infty' alt='-\infty' align=absmiddle>)</li>
<li>infinity &#8211; complex infinity</li>
</ul>
<p>We can use some of these along with common functions:</p>
<pre class="mathcode"><code>sin(%pi/2) + cos(%pi/3);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/9e672e780e892b770dd2e4155e828a74.png' title='\displaystyle \frac{3}{2}' alt='\displaystyle \frac{3}{2}' align=absmiddle>
tan(%pi/3) * cot(%pi/3);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/c4ca4238a0b923820dcc509a6f75849b.png' title='1' alt='1' align=absmiddle>
float(sec(%pi/3) + csc(%pi/3));
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/2539d05d53c6e32c545f090dcee50ee7.png' title='3.154700538379252' alt='3.154700538379252' align=absmiddle>
sqrt(81);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/45c48cce2e2d7fbdea1afc51c7c6ad26.png' title='9' alt='9' align=absmiddle>
log(%e);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/c4ca4238a0b923820dcc509a6f75849b.png' title='1' alt='1' align=absmiddle>
</code></pre>
<h3 style="color: #83b4d8">Defining functions and variables</h3>
<p>Variables can be assigned through a colon &#8216;:&#8217; and functions through &#8216;:=&#8217;. The following code shows how to use them:</p>
<pre class="mathcode"><code>a:7; b:8;
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/8f14e45fceea167a5a36dedd4bea2543.png' title='7' alt='7' align=absmiddle>
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/c9f0f895fb98ab9159f51fd0297e236d.png' title='8' alt='8' align=absmiddle>
sqrt(a^2+b^2);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/22c653d636d63645412c8a575bb1e444.png' title='\sqrt{113}' alt='\sqrt{113}' align=absmiddle>
f(x):= x^2 -x + 1;
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/33b3a90927a24dfb9838f89022ee079b.png' title='x^2 -x + 1' alt='x^2 -x + 1' align=absmiddle>
f(3);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/8f14e45fceea167a5a36dedd4bea2543.png' title='7' alt='7' align=absmiddle>
f(a);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/17e62166fc8586dfa4d1bc0e1742c08b.png' title='43' alt='43' align=absmiddle>
f(b);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/72b32a1f754ba1c09b3695e0cb6cde7f.png' title='57' alt='57' align=absmiddle></code></pre>
<p>Please note that Maxima only offers the natural logarithm function <em>log</em>. <em>log10</em> is not available by default but you can define it yourself as shown below:</p>
<pre class="mathcode"><code>log10(x):= log(x)/log(10);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/73ba23878bd5e988e54ab862989c31b4.png' title='\displaystyle log10(x):=\frac{log(x)}{log(10)};' alt='\displaystyle log10(x):=\frac{log(x)}{log(10)};' align=absmiddle>
log10(10)
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/c4ca4238a0b923820dcc509a6f75849b.png' title='1' alt='1' align=absmiddle></code></pre>
<h3 style="color: #83b4d8">Symbolic Calculations</h3>
<p><em>factor</em> enables us to find the prime factorization of a number:</p>
<pre class="mathcode"><code>factor(30!);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/ac488acd6295bff76bedc4911f61cb47.png' title='\displaystyle 2^{26}\,3^{14}\,5^7\,7^4\,11^2\,13^2\,17\,19\,23\,29' alt='\displaystyle 2^{26}\,3^{14}\,5^7\,7^4\,11^2\,13^2\,17\,19\,23\,29' align=absmiddle>
</code></pre>
<p>We can also factor polynomials:</p>
<pre class="mathcode"><code>factor(x^2 + x -6);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/1ca8d0f0acd5b57415e866fc4c6fa5eb.png' title='(x-2)(x+3)' alt='(x-2)(x+3)' align=absmiddle>
</code></pre>
<p>And expand them:</p>
<pre class="mathcode"><code>expand((x+3)^4);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/62d6a9fcc37d85f633f566c105d7c1ae.png' title='\displaystyle x^4+12\,x^3+54\,x^2+108\,x+81' alt='\displaystyle x^4+12\,x^3+54\,x^2+108\,x+81' align=absmiddle>
</code></pre>
<p>Simplify rational expressions:</p>
<pre class="mathcode"><code>ratsimp((x^2-1)/(x+1));
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/66506113b68a4a541e04ca99ae2f7b4f.png' title='x-1' alt='x-1' align=absmiddle>
</code></pre>
<p>And simplify trigonometric expressions:</p>
<pre class="mathcode"><code>trigsimp(2*cos(x)^2 + sin(x)^2);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/cbfd95f87dd5d4c8d6bae206527a29a8.png' title='\displaystyle \cos ^2x+1' alt='\displaystyle \cos ^2x+1' align=absmiddle>
</code></pre>
<p>Similarly, we can expand trigonometric expressions:</p>
<pre class="mathcode"><code>trigexpand(sin(2*x)+cos(2*x));
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/fad74956a5ef7af04f1d19a03e39eb3d.png' title='\displaystyle -\sin ^2x+2\,\cos x\,\sin x+\cos ^2x' alt='\displaystyle -\sin ^2x+2\,\cos x\,\sin x+\cos ^2x' align=absmiddle></code></pre>
<p>Please note that Maxima won&#8217;t accept 2x as a product, it requires you to explicitly specify 2*x. If you wish to obtain the TeX representation of a given expression, you can use the <em>tex</em> function:</p>
<pre class="mathcode"><code>tex(%);
=&gt; $$-\sin ^2x+2\,\cos x\,\sin x+\cos ^2x$$
</code></pre>
<h3 style="color: #83b4d8">Solving Equations and Systems</h3>
<p>We can easily solve equations and systems of equations through the function <em>solve</em>:</p>
<pre class="mathcode"><code>solve(x^2-4,x);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/584781f5286c23b58cc959f8c7ecfe80.png' title='\displaystyle \left[ x=-2 , x=2 \right]' alt='\displaystyle \left[ x=-2 , x=2 \right]' align=absmiddle>
%[2]
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/566162f3afaf9f5f67e7d7ca7a4b424e.png' title='x=2' alt='x=2' align=absmiddle>
solve(x^3=1,x);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/d6fee10c9270a09a696c50c5779b8e33.png' title='\displaystyle \left[ x={{\sqrt{3}\,i-1}\over{2}} , x=-{{\sqrt{3}\,i+1}\over{2}}  , x=1 \right]' alt='\displaystyle \left[ x={{\sqrt{3}\,i-1}\over{2}} , x=-{{\sqrt{3}\,i+1}\over{2}}  , x=1 \right]' align=absmiddle>
trigsimp(solve([cos(x)^2-x=2-sin(x)^2], [x]));
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/2c16961e1911b211a9d139ec947e6f09.png' title='\displaystyle \left[ x=-1 \right]' alt='\displaystyle \left[ x=-1 \right]' align=absmiddle>
solve([x - 2*y = 14,  x + 3*y = 9],[x,y]);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/e2ab8ed6a972b64d420d68fb6ba413fa.png' title='\left[ \left[ x=12 , y=-1 \right]  \right]' alt='\left[ \left[ x=12 , y=-1 \right]  \right]' align=absmiddle>
</code></pre>
<h3 style="color: #83b4d8">2D and 3D Plotting</h3>
<p>Maxima enables us to plot 2D and 3D graphics, and even multiple functions in the same chart. The functions <em>plot2d</em> and <em>plot3d</em> are quite straightforward as you can see below. The second (and in the case of plot3d, the third) parameter, is just the range of values for x (and y) that define what portion of the chart gets plotted.</p>
<pre class="mathcode"><code>plot2d(x^2-x+3,[x,-10,10]);</code></pre>
<p align="left"><img src="http://math-blog.com/wp-content/uploads/2007/06/2dplot.png" alt="2dplot.png" /></p>
<pre class="mathcode"><code>plot2d([x^2, x^3, x^4 -x +1] ,[x,-10,10]);</code></pre>
<p><img src="http://math-blog.com/wp-content/uploads/2007/06/many_2dplot.png" alt="many_2dplot.png" /></p>
<pre class="mathcode"><code>f(x,y):= sin(x) + cos(y);
plot3d(f(x,y), [x,-5,5], [y,-5,5]);</code></pre>
<p><img src="http://math-blog.com/wp-content/uploads/2007/06/3dplot.png" alt="3dplot.png" /></p>
<h3 style="color: #83b4d8">Limits</h3>
<pre class="mathcode"><code>limit((1+1/x)^x,x,inf);
=&gt; %<img src='http://math-blog.com/wp-content/latex/pictures/e1671797c52e15f763380b45e841ec32.png' title='e' alt='e' align=absmiddle>
limit(sin(x)/x,x,0);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/c4ca4238a0b923820dcc509a6f75849b.png' title='1' alt='1' align=absmiddle>
limit(2*(x^2-4)/(x-2),x,2);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/c9f0f895fb98ab9159f51fd0297e236d.png' title='8' alt='8' align=absmiddle>
limit(log(x),x,0,plus);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/aad18c0a88969b4c1bdc3711475796c2.png' title='-\infty' alt='-\infty' align=absmiddle>
limit(sqrt(-x)/x,x,0,minus);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/aad18c0a88969b4c1bdc3711475796c2.png' title='-\infty' alt='-\infty' align=absmiddle>
</code></pre>
<h3 style="color: #83b4d8">Differentiation</h3>
<pre class="mathcode"><code>diff(sin(x), x);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/40b0247bdb1858c47ce17b56869e55e0.png' title='\displaystyle cos(x)' alt='\displaystyle cos(x)' align=absmiddle>
diff(x^x, x);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/3a5255f71d1e15de254cfa04c87f085a.png' title='\displaystyle x^{x}\,\left(\log x+1\right)' alt='\displaystyle x^{x}\,\left(\log x+1\right)' align=absmiddle>
</code></pre>
<p>We can calculate higher order derivatives by passing the order as an optional number to the <em>diff function</em>:</p>
<pre class="mathcode"><code>diff(tan(x), x, 4);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/6bff92fdb3fa047c82868093cfff3d25.png' title='\displaystyle 8\,\sec ^2x\,\tan ^3x+16\,\sec ^4x\,\tan x' alt='\displaystyle 8\,\sec ^2x\,\tan ^3x+16\,\sec ^4x\,\tan x' align=absmiddle>
</code></pre>
<h3 style="color: #83b4d8">Integration</h3>
<p>Maxima offers several types of integration. To symbolically solve indefinite integrals use <em>integrate</em>:</p>
<pre class="mathcode"><code>integrate(1/x, x);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/4b408871d151e20ef2f9a92928026fa5.png' title='\displaystyle log(x)' alt='\displaystyle log(x)' align=absmiddle>
</code></pre>
<p>For definite integration, just specify the limits of integrations as the two last parameters:</p>
<pre class="mathcode"><code>integrate(x+2/(x -3), x, 0,1);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/19e7d206eb325d951572e8beee3f8a2f.png' title='\displaystyle -2\,\log 3+2\,\log 2+{{1}\over{2}}' alt='\displaystyle -2\,\log 3+2\,\log 2+{{1}\over{2}}' align=absmiddle>
integrate(%e^(-x^2),x,minf,inf);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/e6fd8118b18ff9956c9f35a553e71202.png' title='\sqrt{\% pi}' alt='\sqrt{\% pi}' align=absmiddle>
</code></pre>
<p>If the function <em>integrate</em> is unable to calculate an integral, you can do a numerical approximation through one of the methods available (e.g. <em>romberg</em>):</p>
<pre class="mathcode"><code>romberg(cos(sin(x+1)), x, 0, 1);
=&gt; 0.57591750059682
</code></pre>
<h3 style="color: #83b4d8">Sums and Products</h3>
<p><em>sum</em> and <em>product</em> are two functions for summation and product calculation. The <em>simpsum</em> option simplifies the sum whenever possible. Notice how the product can be use to define your own version of the factorial function as well.</p>
<pre class="mathcode"><code>sum(k, k, 1, n);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/97cd42d8bbc0af5f17507c5cfaf78b78.png' title='\displaystyle \sum_{k=1}^{n}{k}' alt='\displaystyle \sum_{k=1}^{n}{k}' align=absmiddle>
sum(k, k, 1, n), simpsum;
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/0a999c2b37a86051a13075f92e7afb4c.png' title='\displaystyle {{n^2+n}\over{2}}' alt='\displaystyle {{n^2+n}\over{2}}' align=absmiddle>
sum(1/k^4, k, 1, inf), simpsum;
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/85ef0a558c0ffcd2cacd95ccd24c8ca6.png' title='\displaystyle {{\%pi^{4}}\over{90}}' alt='\displaystyle {{\%pi^{4}}\over{90}}' align=absmiddle>
fact(n):=product(k, k, 1, n);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/36a075736ed45788c7d3976b9cd79b1e.png' title='fact(n):=product(k,k,1,n)' alt='fact(n):=product(k,k,1,n)' align=absmiddle>
fact(10);
=&gt;  <img src='http://math-blog.com/wp-content/latex/pictures/96d1a12f00f91e6b4c4fe5ed78cd2794.png' title='3628800' alt='3628800' align=absmiddle>
</code></pre>
<h3 style="color: #83b4d8">Series Expansions</h3>
<p>Series expansions can be calculated through the <em>taylor</em> method (the last parameter specifies the depth), or through the method <em>powerseries</em>:</p>
<pre class="mathcode"><code>niceindices(powerseries(%e^x, x, 0));
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/a5844671a9cf3df35da7cd68fb0a735e.png' title='\displaystyle \sum_{i=0}^{\infty }{{{x^{i}}\over{i!}}}' alt='\displaystyle \sum_{i=0}^{\infty }{{{x^{i}}\over{i!}}}' align=absmiddle>
taylor(%e^x, x, 0, 5);
=&gt; <img src='http://math-blog.com/wp-content/latex/pictures/586ec4d83a99da5df0475baa02385524.png' title='\displaystyle 1+x+{{x^2}\over{2}}+{{x^3}\over{6}}+{{x^4}\over{24}}+{{x^5}\over{120 }}+\cdots' alt='\displaystyle 1+x+{{x^2}\over{2}}+{{x^3}\over{6}}+{{x^4}\over{24}}+{{x^5}\over{120 }}+\cdots' align=absmiddle>
</code></pre>
<p>The <em>trunc</em> method along with <em>plot2d</em> is used when taylor&#8217;s output needs to be plotted (to deal with the <img src='http://math-blog.com/wp-content/latex/pictures/a1886d9a7fa26f5df50f2eb4eec057f0.png' title='+\cdots' alt='+\cdots' align=absmiddle> in taylor&#8217;s output):</p>
<pre class="mathcode"><code>plot2d([trunc(%), %e^x], [x,-5,5]);
</code></pre>
<p><img src="http://math-blog.com/wp-content/uploads/2007/06/taylor.png" alt="taylor.png" /></p>
<p>I hope you&#8217;ll find this useful and that it will help you get started with Maxima. CAS can be powerful tools and if you are willing to learn how to use them properly, you will soon discover that it was time well invested.</p>
]]></content:encoded>
			<wfw:commentRss>http://math-blog.com/2007/06/04/a-10-minute-tutorial-for-solving-math-problems-with-maxima/feed/</wfw:commentRss>
		<slash:comments>112</slash:comments>
		</item>
		<item>
		<title>3 awesome free Math programs</title>
		<link>http://math-blog.com/2007/06/02/3-awesome-free-math-programs/</link>
		<comments>http://math-blog.com/2007/06/02/3-awesome-free-math-programs/#comments</comments>
		<pubDate>Sat, 02 Jun 2007 04:37:51 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[calculus]]></category>
		<category><![CDATA[CAS]]></category>
		<category><![CDATA[Maxima]]></category>
		<category><![CDATA[numerical computing]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[SciLab]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://math-blog.com/2007/06/02/3-awesome-free-math-programs/</guid>
		<description><![CDATA[Mathematical software can be very expensive. Programs like Mathematica, Maple and Matlab are incredibly powerful, flexible and usually well documented and supported. Their price tags however are a big let down for many people, even if there are cheap (in some cases crippled) versions available for educational purposes (if you are a student or a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://gams.nist.gov/">Mathematical software</a> can be very expensive. Programs like <a href="http://en.wikipedia.org/wiki/Mathematica">Mathematica</a>, <a href="http://en.wikipedia.org/wiki/Maple_%28software%29">Maple</a> and <a href="http://en.wikipedia.org/wiki/Matlab">Matlab</a> are incredibly powerful, flexible and usually well documented and supported. Their price tags however are a big let down for many people, even if there are cheap (in some cases crippled) versions available for educational purposes (if you are a student or a teacher). The secondary disadvantages are those caused by the fact that such programs are proprietary. This can also affect or limit a &#8220;sharing oriented&#8221; environment like the academic and research fields. In this short article I propose well known programs that will give you a lot of flexibility and math crunching fun. And with no cost, they are great for all the different <a href="http://education-portal.com/articles/Career_Information_for_a_Degree_in_Math.html">careers with a math degree</a>. All of them have advantages and drawbacks and none of them can be considered perfect or infallible, but I consider them some of the best available today in their respective categories. They are rather general purpose softwares, but there are plenty of other specialized open source programs if you have specific needs. I&#8217;ve chosen one program for each of the 3 macro categories: symbolic, numeric and statistical computing, but you can expect quite a bit of overlapping and shared functionalities. Try the three of them, try the suggested alternatives and settle with the ones that you like and that meet your needs the best.</p>
<h3 style="color: #83b4d8">1. Maxima</h3>
<p>A general purpose <a href="http://en.wikipedia.org/wiki/Computer_algebra_system">CAS </a>(Computer Algebra System) is a program that&#8217;s able to perform symbolic manipulation for the resolution of common problems. As a matter of fact, modern CAS covers an extremely wide range of functionalities. <a href="http://en.wikipedia.org/wiki/Maple_%28software%29">Maple</a> is a prime example of a commercial CAS software. In this category I&#8217;d say that <a href="http://maxima.sourceforge.net/">Maxima</a> is an excellent open source cross platform tool. <a href="http://wxmaxima.sourceforge.net/wiki/index.php/Main_Page">wxMaxima</a> is a good GUI version (possibly the best one on Windows), but other front-ends exist. The 3D plot below was generated by Maxima.</p>
<p style="text-align: center"><img src="http://math-blog.com/wp-content/uploads/2007/06/xsqplusysq.png" alt="3D Chart from Maxima" border="0" /></p>
<p>Valuable mentions are:</p>
<ul>
<li><a href="http://wiki.axiom-developer.org/FrontPage">Axiom</a></li>
<li><a href="http://en.wikipedia.org/wiki/Software_for_Algebra_and_Geometry_Experimentation">Sage</a></li>
<li><a href="http://en.wikipedia.org/wiki/Yacas">Yacas</a></li>
</ul>
<h3 style="color: #83b4d8">2. Scilab</h3>
<p><a href="http://en.wikipedia.org/wiki/Matlab">Matlab</a> is the standard for numerical computing, but there are a few clones and valid alternatives that are entirely free. <a href="http://www.scilab.org/">Scilab</a> is the closest that you can get to Matlab without spending a penny. It&#8217;s very compatible with Matlab (albeit not 100%) but it&#8217;s really flexible, powerful and comes with a Matlab converter and Scicos which is a block diagram modeler and simulator.</p>
<p style="text-align: center"><img src="http://math-blog.com/wp-content/uploads/2007/06/scilab3d.png" title="Scilab Plot" alt="scilab3d.png" border="0" /></p>
<p>Valid alternatives are:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Octave_software">GNU Octave</a></li>
<li><a href="http://mathsrv.ku-eichstaett.de/MGF/homes/grothmann/euler/">Euler</a></li>
</ul>
<h3 style="color: #83b4d8">3. R</h3>
<p>For statistical computing and analysis in the Open Source world, it doesn&#8217;t get any better than <a href="http://en.wikipedia.org/wiki/R_programming_language">R</a>. It is a programming language and environment that enables you to do pretty much anything that the commercial software (<a href="http://en.wikipedia.org/wiki/S-PLUS">S-Plus</a>) does. It is so widely adopted that it can be considered a standard in the field.</p>
<p style="text-align: center"><img src="http://math-blog.com/wp-content/uploads/2007/06/rgraph.png" alt="R plot" /></p>
<p>As usual, please feel free to share your experiences and add your suggestions to enrich the discussion.</p>
]]></content:encoded>
			<wfw:commentRss>http://math-blog.com/2007/06/02/3-awesome-free-math-programs/feed/</wfw:commentRss>
		<slash:comments>92</slash:comments>
		</item>
	</channel>
</rss>
