Stuart’s MATLAB Videos

Watch and Learn

Video tutorial: Infinite series 3

Posted by Doug Hull,

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
 

3 CommentsOldest to Newest

M replied on : 2 of 3
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.
naor replied on : 3 of 3
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?