Doug’s MATLAB Video Tutorials

November 25th, 2008

Video tutorial: Infinite series

In this short video, I explore the math behind this joke: An infinite number of mathematicians walk into a bar.
  The 1st orders a 1     beer.
  The 2nd orders   1/2 a beer.
  The 3rd orders   1/4 a beer.
  ...
  The bartender says
  "You're all idiots",
  and pours two beers.
We will make sure MATLAB shows values as fractions and not decimals and plot the cumulative some of this series
MATLAB Central Files Icon

3 Responses to “Video tutorial: Infinite series”

  1. matt fig replied on :

    Bug report: “…plot the cumulative some of this series”??

  2. M replied on :

    Some sums sometimes approach a summit; and some summits are sometimes some ints. Of course some summits are more infinite than others.

    In related news, the “spam protection” question will now be: Some of 10 + 3?

    … Sounds like you’ve been thinking too hard lately; go enjoy the holiday.

  3. naor replied on :

    I tried to play with this for fun and got into a very frequent and very frustrating problem I have with MATLAB:

    I was trying to do the same exercise with the series 1+1/4+1/9+…+1/n^2…
    but I made the not too unlikely mistake of
    den=[1:n^2]
    instead of
    den=[1:n].^2
    ran it for 5, instantly got 3.8160, ran it for 50, instantly got 8.405, ran it for 500, instantly got 13.0064, ran it for 5000 and instantly locked up MATLAB and had to CTRL+ALT+DEL and kill the process. This happens to me all the time. I can’t be expected to always calculate in my head how much memory an operation is going to take before I hit ENTER, and even if I did I might make a mistake. There must be some way to issue a warning when the user is starting to execute something like this. Although I have no clue on how to distinguish this from a legitimate memory/cpu intensive calculation. Any ideas?

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


Doug Hull is a proud MathWorker who is on a mission to help you with MATLAB.

Doug's picture

These postings are the author's and don't necessarily represent the opinions of The MathWorks.