Math 640: EXPERIMENTAL MATHEMATICS (Probability and Financial Calculus Done Right!) Spring 2015 (Rutgers University) Webpage

http://sites.math.rutgers.edu/~zeilberg/math640_15.html

Last Update: May 18, 2015.


Description

Experimental Mathematics used to be considered an oxymoron, but the future of mathematics is in that direction. In addition to learning the philosophy and methodology of this budding field, students will become computer-algebra wizards, and that should be very helpful in whatever mathematical specialty they are doing (or will do) research in.

We will first learn Maple, and how to program with it. This semester we will learn how to approach Probability and Statistics the way it SHOULD have been developed, had the computer been around at the time of Pascal and Fermat, using what I call "symbol-crunching". After mastering the foundation of probability, we will learn Financial Calculus, that happened to be a very beautiful part of mathematics (even if you are not fond of money), using our symbolic-computational approach.

In addition to the actual, very important content, students will master the methodology of computer-generated and computer-assisted research that is so crucial for their future.

There are no prerequisites (in particular, no knowledge of probability, Maple, or programming experience is assumed). Also, no overlap with previous years.


You are welcome to pick a project

Getting Started Homework (assigned Jan. 21, 2015, due Jan. 22, 2015, 11:30am)


Ask Your Guru


Getting Started


Diary and Homework assignments

Programs done on Thurs., Jan. 22, 2015

C1.txt , Contains procedures

Homework for Thurs., Jan. 22, class (due Sunday Jan. 25, 10:00pm)

All homework should be uploaded to the secret directory that you gave me, as file hw1.txt
  1. (For novices only) Read and do all the examples, plus make up similar ones, in the first 30 pages of Frank Garvan's awesome Maple booklet ( part 1, part 2)
    Only record a small sample in hw1.txt .
    Note: a few commands are no longer valid in today's Maple. The most important one is that " has been replaced by %.

  2. [For Novices only] Write a procedure CheckPie2(A,B) that inputs two sets of integers and checks the Inclusion-Exclusion Principle for two sets:
    |A union B|=|A|+|B|-|A intersect B|

  3. [For everyone] Modify procedure DoN(N), call it DoNs(N) (s for silent) that removes all the print statements and only outputs the number of coin tosses that it took to exit with one dollar.

  4. [Mandatory for experts, optional but recommended for novices] Using the above-mentioned DoNs(N) write a program
    AveDuration(N,K)
    that runs DoNs(N) K times and computes the average duration. What did you get for AveDuration(100,1000);?

  5. [For everyone, human mathematics, but you are allowed to use Maple to sum infinite series]
    Find the exact (theoretical) value of AveDuration(infinity,infinity). What if the coin is not fair but loaded, with probability of winning a dollar p?

  6. [For Experts only] Write a procedure CheckPie(L) that inputs a list of sets L (let's put k=nops(L)) and checks the Inclusion-Exclusion Principle for k sets:
    |L1 union ... union Lk|=|L1|+ ... + |Lk| -(|L1 intersect L2|+|L1 intersect L3|+ ...) + ... +(-1)^(k-1)|L1 intersect L2 intersect ... intersect Lk|
  7. [For experts only] Generalize DoN(N) and write a program
    DoNg(N,p)
    where the probability of winning a dollar is p. You should assume that p is a rational number.

  8. (For everyone) Get ready for the next class by reading the wikipedia articles on the Monty Hall Problem and the St. Petersburg paradox

Added Jan. 26, 2015: See the students' nice Solutions to the 1st homework assignment

Programs done on Monday, Jan. 26, 2015

C2.txt , Contains procedures

Homework for Monday, Jan. 26, class (due Sunday Feb. 1, 10:00pm)

All homework should be uploaded to the secret em15 directory that you gave me, as file hw2.txt . Please have in the first line

#Name
#Date, Assignment hw2.txt
#OK to Post
OR:
#Please Do Not Post

  1. (For novices only) Read and do all the examples, plus make up similar ones, pages 30-60 of Frank Garvan's awesome Maple booklet ( part 1, part 2)
    Only record a small sample in hw2.txt .
    Note: a few commands are no longer valid in today's Maple. The most important one is that " has been replaced by %.

  2. [For everyone] Generalize MH() to MHg(p) where p is a rational number between 0 and 1 (inclusive) and your probability of guessing the correct door (by our convention, door #1) is p.

  3. [For everyone] Ditto for MHs(), and call it MHgs(p). Experiment with running it for say 1000 times, with various p. Confirm empirically the claim that if p is less than 1/2 then it is good to adopt the switching strategy, but if p is larger than 1/2 then it is better to stand by your initial guess.

    Hint: to generate a loaded coin with probability p=a/b, where and b are integers, use
    evalb(rand(1..b)()<=a);

  4. [For everyone] Write a short program, calling it SDsim(N) that simulates (kind of) SD(1/N,1/(N-1), 0), i.e. in a population of N people (whose names are 1,2, ...N) there is exactly one sick person (but no one knows who he or she is), each equally likely to be the sick one, and he or she would definitely be diagnosed sick (since FN=0), and out of the N-1 healthy people, exactly one would be diagnosed (falsely) sick (of course this is a different scenario than the probability of each of them to be falsely diagnosed sick being 1/(N-1), but let's keep it simple.) So in every run one person would be real sick, and one person would be healthy-but-declared-sick. The output is a pair of (distint) integers [rs,fs]. By running it many times, convince yourself (the obvious fact, using "logical reasoning") that each person would be roughly an equal number of times really sick and falsely sick.

  5. [Mandatory for experts, recommended challenge to novices] Generalize BD(k,N) to BDg(k,N,r) that returns true if you can't find two persons, out of the k people that are ≤r apart. Note that BGg(k,N,0) is the same as BD(k,N). Also note that in class BD(19,365) happened to be true, but BDg(19,365,1) happened to be false.

    Hint: instead of the set of birthdays, consider the list of birthdays, and then sort them [using the Maple command sort] and check if no consecutive entries are ≤ r apart]

  6. [Optional, Human mathematics, for everyone, a BIG challenge, 5 dollars to be divided by those who get it] Derive an explicit formula for the probability BDg(k,N,r) in terms of the integers k,N,r.
    [Note that   BDg(k,N,0)=BD(k,N)=binomial(N,k)*k!/N^k ]

    Check your formula (approximately, of course), by running the simulation program BDg(k,N,r) many times for various k,N,r. In particular for k=19, N=365, and r=1.

  7. [Mandatory for experts, recommended challenge for novices]

Added Feb. 2, 2015: See the students' nice Solutions to the 2nd homework assignment


Programs done on Thursday, Jan. 29, 2015

Homework for Thurs., Jan. 29, class (due Sunday Feb. 1, 10:00pm)

All homework should be uploaded to the secret em15 directory that you gave me, as file hw3.txt . Please have in the first line

#Name
#Date, Assignment hw3.txt
#OK to Post
OR:
#Please Do Not Post

  1. (For novices only) Read and do all the examples, plus make up similar ones, pages 60-90 of Frank Garvan's awesome Maple booklet ( part 1, part 2)
    Only record a small sample in hw3.txt .
    Note: a few commands are no longer valid in today's Maple. The most important one is that " has been replaced by %.

  2. [For everyone] Extend MS(N,k,M) to write a procedure

    MS(N,k,M,eps)

    That inputs a positive integer N, a positive integer k (smaller than N, in practice much smaller), a large integer M, and a small number eps, and outputs the number of times the estimated probability was not in the interval [1/2-eps,1/2+eps]

    What did you get for

  3. [For everyone] modify procedure Post(L,M) of C3a.txt , call it

    PostV(L,M)

    that checks that L and M are good inputs, and returns FAIL if it is not, and prints out an explanation why it is not. Remember that L is a list, M is a list of lists each of its elements has the same length, L can only have probabilities, they should add up to 1, etc. etc.

  4. Search the internet for some neat real-life examples of using Post(L,M). For example, find out the probability of a heavy smoker, moderate smoker, and non-smoker to die of lung cancer, the statistics of the current percentage in the US of these categories, and figure out, if you hear that someone died of lung cancer, but you don't know him or her, the probability of him being (i)a heavy smoker (ii) a light smoker (iii) a non-smoker.

  5. Make up some nice stories where Post(L,M) can be used

  6. Get ready for the next class by reading the wikipedia entries on Probability Distribution and expected value

Added Feb. 2, 2015: See the students' nice Solutions to the 3rd homework assignment


Programs done on Monday, Feb. 2, 2015