Last Update: May 3, 2021
Dr. Zeilberger's Email: DoronZeil at gmail dot com ; Official Email: zeilberg@math.rutgers.edu
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, from an experimental mathematics point of view, algorithmic enumerative and statistical combinatorics. The final projects may lead to published papers. People who already took previous editions are welcome to take it again, since except for the basics, there is very little overlap with previous editions.
This class is suitable for graduate students in other departments, and the software development skills learned will be useful for doing any quantitative research. Smart advanced undergraduates are also welcome. In particular, the statistical methods learned for researching enumerative combinatorics should be applicable almost everywhere.
Added March 22, 2021: Pick a class Final project.
[See also Hao Huang's original article and Jean-Paul Delahaye's charming April 2021 column (en Francais, appared in Pour La Science, April 2021).]
For more details, see this 2002 masterpiece.
It should be sent to the email address
ShaloshBEkhad at gmail dot com
Subject: HomeWork#X
and then attach a .txt file(s) called
hwXYourFirstNameYourLastName.txt
where X is the number of the assignment
Except for the first assignment, you should have two attached .txt files.
For example, when Yukun Yao submits homework assignments 2 and 3, he should email ShaloshBEkhad at gmail dot com, with
Subject: HomeWork#2#3
and attach the text files (the source code plus human comments (such lines must start with #)
hw2YukunYao.txt and hw3YukunYao.txt
#Please do not post homework
or
#OK to post homework
Followed by
#Your Name, Date, Assignment X
Lecture 1 ( Thurs., Jan. 21, 2021)
IsDer(pi): inputs a permutation of {1,...,n} pi (n=nops(pi)) and outputs true iff it is a derangement
RandDer(n): Generates a random derangement of {1,...,n}, using the NAIVE approach suggested by5A Alon Itai in his not entirely-raving Math review of the Nijenhuius-Wilf classic
Subject: hw#1
and an attachment
hw1FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Read and understand the introduction and Chapter 1 of the Nijenhuis-Wilf masterpiece Do not worry about the details.
FP(pi)
that inputs a permutation pi of {1,...n}, (where n=nops(pi)) and outputs an integer between 0 and n indicating the number of fixed points, i.e. the number of places i such that pi[i]=i. Note that if pi is a derangement, then FP(pi)=0.
RandAlmostDer(n,k)
that inputs a positive integer n, another positive integer k, (between 0 and n) and outputs a random permutation whose number of fixed points is <=k. Note that RandAlmostder(n,0) does the same thing as RandDer(n)
EstimateAveFP(n,K)
thas inputs a positive integer n, and a large positive integer K, picks randompermutations of {1,...,n} (using randperm(n) in the combinat package of Maple) and outputs the average number of fixed points. By taking K fairly large, say K=10000, and various n, can you guess the exact value?
EstimateMomFP(n,r,K)
thas inputs a positive integer n, another positive integer, r, and a large positive integer K, picks randompermutations of {1,...,n} (using randperm(n) in the combinat package of Maple) and outputs the average number of FP(pi)^r. Note that EstimateMomFP(n,1,K) does the same thing as EstimateAve(n,K). By taking K fairly large, say K=10000, r=2, and various n, can you guess the exact value of the average of FF(pi)^2?
Added Jan. 25, 2021: The students' nice solutions can be found in this directory
Lecture 2 ( Monday., Jan. 25, 2021)
Box(L): Inputs a list L (where k=nops(L)) of non-negative integers L outputs the LIST of all LISTS [a1,a2,..., ak] in LEX ORDER such that ai is in {0,1,.., L[i]) In particular the n-dim UNIT cube would be Box([1$n]);
Subject: hw#2
and an attachment
hw2FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
CheckBij(n)
that checks that SetToVec(VecToSet(v),n)=v is always true for each member of Box([1$n]) and VecToSet(SetToVec(S,n))=S for each member of MyPS({seq(i,i=1..n)}) .
[A little bit challenging] Write a procedure NextInLine(L,v) that inputs a list L and a member v of the list of lists (dictionary) and returns the vector right after it (in dictionary (lex.) order) without actually constructing the (usually) very large set Box(L)
Added Feb.1, 2021: The students' nice solutions can be found in this directory
Lecture 3 (Thursday, Jan. 28, 2021)
Subject: hw#3
and an attachment
hw3FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
NewUCG(n)
that has the same input and output as UCG(n), but instead starts with the vector [0$n] and keeps applying NEXG(w), always appending the new guy to the list. Check that UCG(n)=NewUCG(n) are the same for n from 1 to 14.
Generalize UCG(n) to write a procedure
BoxG(L)
that inputs a list of positive integers and outputs a list whose members are the same as Box(L), but in such an order that when you go from one member to the next, it only changes in one place
What is
BoxG([2,2,2])?
Tomorrow(Date), Yesterday(Date)
that inputs four-tuple
Date=[DayOfTheMonth , Month , Year, DayOfTheWeek ]
and outputs the dates of the next day, and previous day, respectively.
For example
Tomorrow([28,1,2021,5]), Yesterday([28,1,2021,5])
should output [29,1,2021,6], [27,1,2021,4] respectively
[Hint: Feb. has 28 days except in leap years. A leap year is a multiple of 4 with the exception that a multiple of 100 is not a leap year with the exception2 that a multiple of 400 is a leap year.]
w:=RBW(3261): NEXG(w):
But when I did
w:=RBW(3262): NEXG(w):
I got an error Maple, exceeding the "stack" length that handles recursion in Maple. Is there a way to change it?
Added Feb.1, 2021: The students' nice solutions can be found in this directory
Lecture 4 (Monday, Feb. 1 2021)
FOR EXAMPLE Rnk(3,2) should output each of {1,2},{1,3},{2,3} with prob. 1/3
Subject: hw#4
and an attachment
hw4FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
G(n,k)=G(n-1,k)+G(n-1,k-1)
RnkFast(n,k) by replacing the line
LD([NuSnk(n-1,k), NuSnk(n-1,k-1)])
By
LD([n-k,k])
First explain why it is valid, and then find out, for fairly large n and k (say n=5000, k=2000) whether it is indeed faster. Why?
EstimateAveMax(n,k,K)
that uses Rnk(n,k) (or if you prefer, your RnkFast(n,k)) K times, and estimates the average of the quantity (max(S)) over all k-element subsets of {1,...,n}. Experiment it with various n and k, and K=1000.
(ii) [Optional human challenge] Can you find the EXACT value of that average as an expression in n and k?
EstimateAveSum(n,k,K)
that uses Rnk(n,k) (or if you prefer, your RnkFast(n,k)) K times, and estimates the average of the quantity sum(S) over all k-element subsets of {1,...,n}. Experiment it with various n and k, and K=1000.
(ii) [Optional human challenge] Can you find the EXACT value of that average as an expression in n and k?
Wnk(a,b), NuWnk(a,b), RWnk(a,b)
that input non-negative integers a,b, and outputs, respectively, the set of all words in {1,2} with a 1s, b 2s, their number, and a random such word.
W3nk(a,b,c), NuW3nk(a,b,c), RW3nk(a,b,c)
that input non-negative integers a,b, c and outputs, respectively, the set of all words in {1,2,3} with a 1s, b 2s, c 3s, their number, and a random such word.
WORDS(L), NuWORDS(L), RandWORD(L)
that inputs a list L, of length k, say, (i.e. nops(L)=k) of non-negative numbers, and outputs, respectively, the of all words in the alphabet {1,2,...k} with exactly L[1] 1s, L[2] 2s, ..., L[k] k-s, their number, and a random such word.
Lecture 5 (Thurs., Feb. 4, 2021)
Expa(pi,S): inputs a permutation pi of 1,..., nops(pi) and
a sorted list of distinct numbers S, replaces 1 by
the smallest member of S, etc.
For example
Expa([2,1,3],[11,13,15])= [13,11,15]
Subject: hw#5
and an attachment
hw5FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
PermuG(n)
that inputs a non-negative integer n and outputs a list of all permutations of {1,...,n} such that when you move along the list the next permutation is an adjacent transposition (swapping neighboring entries).
[Hint, it is a relatively minor tweak of PermuI(n), but the sliding of "n" changes direction at reach pass]
NextPG(pi), PrevPG(pi)
That inputs a permutation pi of {1, ...,n} for some n, and outputs the ones that come right after (and right before it, respectively) in the above PermuG(n), but of course, without actually constructing this super-exponentially large set.
Run
pi:=randperm(100): NextPG(pi): PrevPG(pi), evalb(NextPG(PrevPG(pi))=pi),evalb(PrevPG(NextPG(pi))=pi)
For several random permutations
MyRandPermA(n), MyRandPermI(n)
that input a non-neg. integer n and outputs a random permutation of {1,...,n} (uniformly at random)
using
(i) The pre-pending paradigm, inspired by PermuA(n)
(ii) The insertion paradigm, inspired by PermuI(n)
compare the timing of combinat[randperm](n), and your MyRandPermA(n), MyRandPermI(n), for n=1000000. How do the timings compare?
Write a procedure
NoABC(n)
That inputs a positive integer n and outputs the set of permutations AVOIDING the pattern 123.
Find
[seq(nops(NoABC(n)),n=1..8)]
Is it in the OEIS? What is its A number?
Added Feb.8, 2021: The students' nice solutions can be found in this directory
Lecture 6 (Monday, Feb. 8, 2021)
RandWalk2D(A,pt): inputs a list of atomic steps A and a final destination pt, outputs UNIFORMLY at random a walk from [0,0] to pt using the steps in A
GWalks2D(A,pt): Inputs a list A of `atomic' steps A in the form [a,b] (with a,b non-neg. and a+b>0) and a final location (final score in game, e.g. [31,9]). OUTPUTS the SET of all GOOD (subdiagonal) WALKS from [0,0] to to pt, described by giving the intermediate location
Subject: hw#6
and an attachment
hw6FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
(i) seq(NuWalks2D([[1,0],[0,1]],[i,i]),i=1..20):
(ii) seq(GNuWalks2D([[1,0],[0,1]],[i,i]),i=1..20):
(iii)seq(NuWalks2D([[1,0],[0,1],[2,0],[0,2]],[i,i]),i=1..20):
(iv) seq(GNuWalks2D([[1,0],[0,1],[2,0],[0,2]],[i,i]),i=1..20):
(v) seq(NuWalks2D([[1,0],[0,1],[2,0],[0,2],[3,0],[0,3]],[i,i]),i=1..20):
(vi) seq(GNuWalks2D([[1,0],[0,1],[2,0],[0,2],[3,0],[0,3]],[i,i]),i=1..20):
(vii) seq(NuWalks2D([[1,0],[0,1],[1,1]],[i,i]),i=1..20):
(viii) seq(GNuWalks2D([[1,0],[0,1],[1,1]],[i,i]),i=1..20):
(ix) seq(NuWalks2D(FootBall(),[i,i]),i=1..20):
(x) seq(GNuWalks2D(FootBall(),[i,i]),i=1..20):
(i)Using NuWalks2D and GNewWalks2D (that you wrote), conjecture an explicit expression for the probability that in a soccer game that ended with a tie [n,n], the visiting team was Never (strictly) leading.
(ii) [Optional human challenge] Prove your conjecture (it is OK to "peak" at the internet or books)
NuWalkskD(A,pt) and GNuWalkskD(A,pt) and
(let k=nops(pt), and assume that all the members of A are lists of length k)
What are the OEIS A-numbers (if they exist) of
(i) seq(NuWalkskD([[1,0,0],[0,1,0],[0,0,1]],[i,i,i]),i=1..10):
(ii) seq(GNuWalkskD([[1,0,0],[0,1,0],[0,0,1]],[i,i,i]),i=1..10):
(iii) seq(NuWalkskD([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],[i,i,i,i]),i=1..10):
(iv) seq(GNuWalkskD([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],[i,i,i,i]),i=1..10):
Added Feb.15, 2021: The students' nice solutions can be found in this directory
Lecture 7 (Thurs., Feb. 11, 2021)
Subject: hw#7
and an attachment
hw7FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
NiceValentine()
that outputs a nice valentine that contains the text "I love Experimental Mathematics". The Maple code should he in hw7FirstNameLastName.txt, but the output (as a .jpeg file) should be submitted as an attachment. You should use the Maple plot package. If possible use plot3d.
DrawMandelbrot(R,K)
that plots the Mandelbrot set by picking all those complex c (of the form x+I*y, with x,y in [-4,4] with resolution 1/R, and deciding whether to accept it if iterating z goes to z^2+c (starting at z=0) after K iterations stay bounded. Also send the output as .jpeg file, for R as large as possible.
RandSPn(n)
that inputs a positive integer n and outputs a (uniformly) at random set partition of {1,...,n}
(i) Write a procedure
NuAdjacentMates(SP,n)
that inputs a set partition, SP, of {1, ...n}, and outputs the number of i between 1 and n such that i and i+1 are part-mates
(ii) Write a procedure
EstimateAvAdjacentMates(n,K)
that uses the above procedure, and your RandSPn(n), K times, to estimate the average of the number of adjacent mates in a random set partition of {1,...n}. What did you get for
EstimateAvAdjacentMates(100,1000)?
(run it several times to make sure that they are close)
(iii) [Optional challenge] Find an explicit formula (or efficient algorithm) to find the EXACT value, of that average, for a general n.
Added Feb.15, 2021: The students' nice solutions (including GORGEORUS Valentines and Mandelbrojt sets) can be found in this directory
Lecture 8 (Monday, Feb. 15, 2021)
Subject: hw#8
and an attachment
hw8FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
SPnF(n)
that inputs a non-neg. integer n and outputs the set of set-partitions of {1,..,n} using the NEW approach (the one used in NuSPnF(n) and RandSPn(n)
a(n)=Number of CONNECTED labeled graphs on n vertices is
is
log(Sum(2^(n*(n-1)/2)*x^n/n!,n=0..infinity)
Use the taylor command in Maple to find the first 30 terms. Is it in the OEIS?
Pn(a)
be the polynomial in a (of degree n*(n-1)/2) whose coefficient of a^k is the number of CONNECTED labeled graphs on exactly k edges.
Using a "weighted generalization" of the exponential formula, convince yourself that
Sum(Pn(a) xn/n!,n=0..infinity)= log(Sum((1+a)^(n*(n-1)/2)*x^n/n!,n=0..infinity)
NuCG(n,k)
that inputs positive integers n and k, and outputs the number of labeled connected graphs with n vertices and k edges.
(i) What is seq(NuCG(n,n-1),n=1..20)? What is its OEIS A-number (if it exists)
(ii) For which r=0,1,2,3,... are the sequences
seq(NuCG(n,n+r),n=1..20)? in the OEIS? What are their A numbers? What is the smallest r that is NOT in the OEIS.
Added Feb.22, 2021: The students' nice solutions are in this directory
Subject: hw#9
and an attachment
hw9FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
(x d/dx)^k (f(x)/xμ)|x=1
Using this, finish writing procedure SAc(f,x,K), that we barely started in class.
Make sure that
SAc(Pgf(X,x),x,8)=SA(X,8)
for several X obtained by using RRV(100,1000) (say)
Using the above-mentioned SAc that you wrote above, and leaving n symbolic, find closed-form expressions for the average, variance, and third through the 10th scaled moments. By using Maple's limit command, find the limits. Can you conjecture an explicit expression for the k-th scaled moment as an expression in k?
Using procedure RandSPn(n), with n=100,200,300 from C8.txt , 10000 times, and SA(X), estimate the average and variance of the random variable "number of parts" of a random set-partition of {1,...,n}. See how close it is to the exact values
μ:=Sum(k*Snk(n,k),k=0..n)/Bell(n)
sig2:=Sum((k-μ)2*NuSPnk(n,k),k=0..n)/Bell(n)
Added Feb. 22, 2021: The students' nice solutions are in this directory
Lecture 10 (Monday, Feb. 22, 2021)
Subject: hw#10
and an attachment
hw10FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
The major index, denoted by maj(π), is the SUM of the places i, such that π[i] > π[i+1] [For example maj(631425)=1+2+4=7]
ExactGFinv(n,x) ,ExactGFmaj(n,x) , ExactGFdes(n,x)
that inputs a positive integer n and a variable name n, and outputs the generating function whose coefficient of xk is the exact number of permutations with inv=k, maj=k, des=k, respectively.
Try to conjecture (or derive mathematically) closed form or efficient recurrences for these generating functions that will enable you to easily compute them for say n=100. [Warning: I don't think that the g.f. according to des has a nice closed form, but it has a recurrence]
EstGFinv(n,x,K) ,EstGFmaj(n,x,K) , EstGFdes(n,x,K)
that samples K random permutations and finds the empirical prob. gen. function. Compare plotDist and SAc for up to the 8th moment, with n=100, and K=2000.
Sum(Pn(t) xn/n!,n=0..infinity)= exp(t*(exp(x)-1) )
Using Maple's command "taylor", write a procedure
PnSeq(N,t)
That inputs a positive integer N and outputs the first N terms of Pn(t)
(i) Using SAc, do they seem to be asymptotically normal?
(ii) [I don't know the answer] Does the average number of parts and the variance divided by n tend to some constants?\
Added March 1, 2021: The students' nice solutions are in this directory
Lecture 11 (Thurs., Feb. 25, 2021)
Sum(p(n)qn, n=0..infinity)=Product(1/(1-qi),i=1..infinity):
Subject: hw#11
and an attachment
hw11FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
RandPnk(n,k), and RandPn(n)
that, respectively, generate, uniformly at random, a partition of n with largest part k, and a partition of n
EstStatAnalOfLargestPart(n,K,N)
that inputs a positive integer n and a fairly large K, and (using previous functions), estimate the expectation, variance, and the 3rd- through K-th scaled moments, of the r.v. "number of parts" when running over the sample space of (integer) partitions of n.
Run
EstStatAnalOfLargestPart(100,10000,6)
several times and see of they are not too far from each other (especially the expectation and variance)
Then run
EstStatAnalOfLargestPart(200,10000,6)
several times, and see whether the 3rd, and 4th scaled moments are close to the previous ones for n=100.
Let Pn(t) be the weight-enumeator of the set of integer partitions of n, according to the r.v. "number of parts"
For example, Par(4)={[4],[3,1],[2,2],[2,1,1],[1,1,1,1]}, so the naive count of Par(4) (what we call Pn(4)), i.e. pn(4), is 5.
The weight-enumerator, according to the weight "number of parts" is
P4(t)=t^nops([4])+ t^nops([3,1])+ t^(nops([2,2]))+t^nops([2,1,1])+ t^nops([1,1,1,1]) =t^1+t^2+t^2+t^3+t^4=t^4+t^3+2t^2+t
So [seq(Pn(t),n=0,1,2,3...] is an infinite sequence of POLYNOMIALS, in t, such that Pn(1)=pn(n)
Convince yourself that the generating function, with respect to the variable q, viewing t as a parameter is:
Sum(Pn(t) qn, n=0..infinity)=Product(1/(1-tqi),i=1..infinity):
pnSeqGFt(N,t)
that inputs N, and a variable t, and outputs the first N+1 (starting at n=0) of the sequence {Pn(t)} mentioned in the previous problem.
For example the output of pnSeqGFt(4,t) should be
[1,t,t^2+t,t^3+t^2+t,t^4+t^3+2t^2+t]
Find the EXACT average, expectation, and the 3rd through 6th scaled moments of the r.v. "number of parts" for n=100, n=200. How do they compare with the estimate?
Added March 1, 2021: The students' nice solutions are in this directory
Lecture 12 (Monday, March 1, 2021)
Contains procedures:
Subject: hw#12
and an attachment
hw12FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
PnkC(n,k,S,m), PnC(n,S,m), RandPnkC(n,k,S,m), RandPnC(n,S,m), pnkC(n,k,S,m), and pnC(n,S,m) that input in addition of n (and sometimes k) also a set S that is a subset of {0,1,..,m-1} and a positive integer m, and outputs respectively
Note that if S={0} and m=1, you get back the original functions.
PnkD(n,k,DI), PnD(n,DI), RandPnkD(n,k,DI), RandPnD(n,S,DI), pnkC(n,k,DI), and pnD(n,DI) that input in addition of n (and sometimes k) also a set DI that is a set of non-negative integers and outputs respectively
Note that if DI={} you get back the original functions.
Added March 8, 2021: The students' nice solutions are in this directory
Lecture 13 (March 4, 2021)
Contains procedures:
SeqFnF(N): the first N+1 terms of the Fibonacci numbers using the RECURRENCE
Subject: hw#13
and an attachment
hw13FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
Prod(1-q^i,i=1..infinity)= 1+ Sum((-1)^j *(q^((3*j-1)*j)/2+q^((3*j+1)*j)/2),j=1..infinity)
implies the recurrence
p(n)=-Sum((-1)^j* p(n-((3*j-1)*j)/2),j=1..infintiy) - Sum((-1)^j* p(n-((3*j+1)*j)/2),j=1..infinity)):
where "infinity" is replaced by the largest j that make the argument of p non-negative.
Then write procedure, pnE(n), that implements it. Then write, pnSeqE(N), that has the same output as pnSeq(N) and pnSeqGF(N), but hoplefully is faster. Compare the running times for N=1000, N=2000 (and possibly higher values)
Franklin(L)
that implements Fabian Franklin's beautiful proof of Euler's Pentagonal Theorem.
It should input a distinct integer partition (i.e. an integer partition with distinct parts), and outputs another one with one or less number of parts. It should return FAIL, if it not applicable.
PnD(n,DI)
From homework 12, with DI={0}, write a procedure
FranklinOldMaids(n)
that inputs a non-negative integer n, and outputs the (usually empty, and otherwise a singleton, if you believe Euler) partitions for which Franklin(L) returns FAIL. Can you find a structure to thoese "old maids".
Added March 8, 2021: The students' nice solutions are in this directory
Lecture 14 (Monday, March 8, 2021)
Contains procedures:
pnE(n): The number of (integer) partitions of n using Euler's recurrence
Franklin(L): implements Franklin's bijecive proof of Euler's Pentagonal Theorem
FranklinOldMaids(n) inputs a non-negative integer n, and outputs the partitions for which Franklin(L) returns FAIL.
Subject: hw#14
and an attachment
hw14FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
BZ(L,j)
that inputs a partition L and an integer j, and outputs a pair [L', j'] where j' has opposite parity than j and
|L|+(3*j-1)*j/2 =|L'|+(3*j'-1)*j'/2
Glashier(L), InvGlashier(L)
that input a partition into odd parts, and a partition into distinct parts, respectively, and perform Glashier's (look it up) famous bijective proof that these are equinumerous.
Added March 15, 2021: The students' nice solutions are in this directory
Lecture 15 (Thurs., March 11, 2021)
Contains procedures:
ud(n): The NUMBER OF up-down permutations of length n using the non-linear recurrence
ud(n)=Sum(i=1..trunc(n/2), binomial(n-1, 2*i-1)*ud(2*i-1)*ud(n-2*i))
evalf(2*n*ud(n-1)/ud(n))
converges to Pi, since (as you are going to prove in the homework, and we discovered experimentally in class)
Sum(ud(i)*x^i/i!,i=0..infinity)= csc(x)+ tan(x)
and that the closest root of the denominator is Pi/2, hence that is the radius of convergence, and the rest follows from the ratio test from calculus.
Subject: hw#15
and an attachment
hw15FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
UDbetter(n)
that outputs the same thing a UD(n), but using the ideas behing the enumeration procedure ud(n)
( Hint, you are welcome to use the Maple command combinat[choose] )
Added March 15, 2021: The students' nice solutions are in this directory
Lecture 16 (Monday, March 22, 2021)
Contains procedures:
LT(n,k): The SET OF REDUCED n by k LATIN TRAPEZOIDS The bottom line is 1,...,n, and each floor above it of length n-1,n-2, .., n-k+1 has all DIFFERENT entries also VERTICALLY all different also A[i][i],A[i+1][i+1], ... are all different
Subject: hw#16
and an attachment
hw16FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
ComputCons(F, P, n, d)
that inputs an F, that is a product and/or quotient of expressions of the form (a*n+b)! (e.g. binomial(2*n,n)/10^n), a polynomial P in n, a variable name n, and a positive integer d, and outputs the value of
Sum(((-1)^n*P(n)*F(n),n=0..infinity)
to d decimail digits.
Hint: first find the simplified version of P/subs(n=n-1,P) and call it something.
Use your procedure to compute the constant
Sum(((-1)^n*(n^3+1)*k^n/binomial(2*n,n)^10,n=0..infinity)
for k=1,2,3,...
and compare it with just using the Maple add command.
Is seq(nops(LT(i,i)),i=1..7); in the OEIS?
If it is, what is the A number? What is its meaning in the OEIS?
Added March 29, 2021: The students' nice solutions are in this directory
Lecture 17 (Thurs., March 25, 2021)
Contains procedures:
Subject: hw#17
and an attachment
hw17FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
Can you find inputs for which JC(P,x,m,K) is much faster than JC1(P,x,m,K)?
CheckMordell(N)
that verifies that τ(p)*τ(q)=τ(pq) for all primes p,q, between 2 and N. Please use RseqFF(24,N), with N as large as your computer would agree to.
CheckDeligne(N)
that outputs the primes between 2 and N such that |&tau[(p)|/2 p11/2 is as small as possible, followed by its value (that hopefully is less than 2). Who is the lucky prime? What is the value of |τ(p)|/2 p11/2 for that lucky prime?
If you make N larger, do you get new champions? Perhaps you can sharpen Deligne's theorem and replace 2 by something smaller?
Added March 29, 2021: The students' nice solutions are in this directory
Lecture 18 (Monday, March 29, 2021)
Subject: hw#18
and an attachment
hw18FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
Aigner(n)
that inputs a positive integer, and uses Martin Aigner's ingenious lexigoraphic greed idea to output a Symmetic Chain Decomposition of the Boolean Lattice
For example, Aigner(2) should return
[ [[],[1],[1,2]] , [[2]] ]
SCD(n)
that uses the idea at the very end of the lecture to construct from each chain of SCD(n-1) by creating two new chains of SCD(n). Verfy that you get the same output as Aigner(n)
Added April 5, 2021: The students' nice solutions are in this directory
Lecture 19 (Thurs, April 1, 2021)
C19.txt ,
Please see the various Helps19 and the comments in the above file (too numerous to list here)
We discussed three famous NP hard problems.
Subject: hw#19
and an attachment
hw19FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
[A challenge, I don't know the answer] Write a version of CrP(G,t), call it
CrPbetter(G,t)
That tries to pick an "optimal edge" to delete/contract with each time, using a subroutine
BestEdge(G)
That picks the best edge (using some criteria) rather than a random one (like in the original code)
Added April 5, 2021: The students' nice solutions are in this directory
Lecture 20 (Nonday, April 5, 2021)
C20.txt ,
Contains procedures
Subject: hw#20
and an attachment
hw20FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
AvHD(S)
that inputs a set of vectors S and outputs the average number of neighbors a vertex has, rather than the maximum
AvAv(Dim,J,K)
that inputs Dim, J (like in Hao(Dim,J)) and a LARGE integer K, and by using combinat[randcomb](Box(Dim),J) picks K random subsets, for each computes AvHD(S), and averages over all of them. What are your estimates for (run it serval times and see whether you get close answers to each other)
AvAv([2,2,2,2,2,2,2],65,10000) ;
SimuHao(Dim,J,K): that Inputs a list Dim, and an integer J and a large positive integer K, uses combina[randcomb](Box(Dim),J) to generate a random subset of size J, K times, and outputs the "champion" and the "record" among the K sampled sets. What did you get for
SimuHao([2$10],513,10000)?
(If you could investigate all binomial(1024, 513) subesest, the answer, according to Hao Huang, should be ceiling(sqrt(10))=4)
Added April 12, 2021: The students' nice solutions are in this directory
Lecture 21 (Thurs., April 8, 2021)
C21.txt ,
Contains procedures
Subject: hw#21
and an attachment
hw21FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
IntegterToVec(k,n), VecToInteger(v,n)
that inputs an integer k in [1,2^n] (and n) and outputs the vector of length n that corresponds to the binary represenation of k-1 (written as a list) (with zeros padded at the front to make it of length n, if necessary)
and its inverse procedure VecToInteger(v,n)
FindAlpha(H,n)
That inputs a subset of Box([2$n]) and computes the member(s) of H predicted by taking the index (indices) with the largest absolute value of Findy(n,H). Check that its number oe neighbors is indeed the number of neighbors in H (number of other vectors in H whose Hamming distance with it is 1). In other words, the procedure checks the last step in Knuth's version of Hao Huang's proof.
Added April 12, 2021: The students' nice solutions are in this directory
Lecture 22 (Monday, April 12, 2021)
C22.txt ,
Contains procedures
syt(L): inputs an integer partion (given as a weakly decreasing list of POSITIVE integers OUTPUTS the NUMBER of Standard Young Tableax of shape L (n=Number of boxes of L) (A way of filling 1, ..., n in the boxes such that horiz. and vertically they are increasing
Subject: hw#22
and an attachment
hw22FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
Using the Wilf methodogy, with a "loaded die" (from C4.txt ) write a function
randomSYT(L)
that inputs an integer partition L (aka shape) and outputs, uniformly at random, one of the syt(L) Standard Young tableaux of that shape,
TotalSYT(n)
that inputs a positive integer n, and outputs the total number of standard Young tableaux with n cells [Hint: sum-up syt(L) over all members of Pn(n)
Is that sequence in the OEIS? What is its A-number
TotalSYTpower(n,k)
that inputs a positive integer n, and outputs the total number of k-tuples of standard Young tableaux of the same shape with n cells [Hint: sum-up syt(L)k over all members of Pn(n)
Is that sequence for k=2, in the OEIS? What is its A number? What about k=3, k=4, etc.?
The next challenges require you to be honest!, you should do them all by yourself (no internet, no books, nor articles, no asking people, only using Maple and the programs done in C22.txt )
[Added April 15, 2021: This was solved correctly by AJ Bu, Robert Dougerty-Bliss, and Yuxuan Yang (see this directory)]
[Added April 15, 2021: This was solved correctly by Robert Dougerty-Bliss, and Yuxuan Yang (see this directory)]
[Added April 15, 2021: This was solved correctly by Robert Dougerty-Bliss, and Yuxuan Yang (see this directory)]
[Added April 15, 2021: This was solved correctly by Yuxuan Yang (see this directory)]
[Added April 15, 2021: This was solved correctly by Robert Dougerty-Bliss, (see here) and Yuxuan Yang (see here and here) ]
[Added April 15, 2021: This was "almost" solved correctly by Yuxuan Yang (see here). Yuxuan gave a correct expression involving k! terms, so as k gets larger it would be impractical. However, it is possible to express it as a determinant, and use linear algebra to get the formula conjectured by Robert Dougherty-Bliss, the famous Young-Frobenius formula] ]
Added April 15, 2021: The students' nice solutions are in this directory
Lecture 23 (Thurs., April 15, 2021)
C23.txt ,
Contains procedures
Subject: hw#23
and an attachment
hw23FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
RS(pi)
that inputs a permutation pi and outputs a member of STYpairs(n). S is the output of RSleft(pi) and T is the "template" tableau obtained by inserting, in turn 1,2,3,...,n to the new cell that emerges each time the shape of the left tableau increases by one cell. (Look it up "Robinson-Schenstead" in the internet for details)
InvRS(P)
That inputs a pair [S,T] of standard Young tableaux of the same shape and outputs a permutation of 1,2,...n (where n is the number or cells of S (or T))
Check that InvRS(RS(pi)) gives you pi for each pi in permute(7), and RS(InvRS([S,T])=[S,T] for each member of SYTpairs(n)
Added April 19, 2021: The students' nice solutions are in this directory
Lecture 24 (Mon., April 19, 2021)
C24.txt ,
Contains procedures
[Completed after class]
TAB(L,m): the set of all tableaux of shape L with entries in {1,2,...,m}
Subject: hw#24
and an attachment
hw24FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line #Homework by ...
TabPairs(n,m)
that outputs all pairs [S,T] where S is a a (column-strict) tableau with entires from {1,...,m}, and T is a STANDARD tableau of the SAME shape
Added April 26, 2021: The students' nice solutions are in this directory
Lecture 25 (Thurs., April 22, 2021)
C25.txt ,
Contains procedures
ScStupid:(L,x,m): the weight-enumerator, according to the weight
x[1]Number of 1s ...x[m]Number of ms
of the set of tableaux of shape L whose largest entry is m, done the STUPID way, by adding up all the weights of the member of TAB(L,m) of Lecture 24.
This is called the Schur polynomial in the variables x[1],.., x[m], of shape L, usually denoted in books (and articles), by
sλ(x1, ..., xm)
Subject: hw#25
and an attachment
hw25FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line
HookSet(L,cell)
That inputs a shape L and a cell [i,j], with 1≤ i ≤nops(L), 1 ≤ j ≤ L[i], and outputs set set of all cells that are (weakly) to the right in the same row, and (weakly) down in the same column. For example,
HookSet([5,5,3,2,1],[2,2]);
should output the set
{[2,2],[2,3],[2,4],[2,5],[3,2],[4,2]}
[Corrected April 25, 2021, 11:00am, thanks to Blair Seidler, who won a dollar]
Write a procedue
OneStepGNW(L)
that implements one iteration of the beautiful Greene-Nijenhuis-Wilf algorithm, by ( note correction thanks to Blair S.), picking one of the n cells, uniformly at random, and starting at that cell, "walking" to a corner cell, by at each step, (if you are currently at location cell), picking UNIFORMALLY at random a member of
HookSet(L,cell) minus {cell}
and going there, until you hit a corner cell, placing n there.
GNW(L)
That does the same as randomSYT(L).
[You can also do it recursively, using OneStepGNW(L) to find the corner cell where to put n, calling the shrunk shape L1, calling GNW(L1), and adding the above cell with n it it].
Convince yourself that GNW([10,10,10]) is MUCH faster than randomSYT([10,10,10]). How long does it take to get
GNW([9$9]);
syt([a1,a2,..., ak])=n!/Product(hij, over all the n cells [i,j] of L)
Is equivalent to the Robert-Dougerty-Smith formula (previously called the Young-Frobenius formula) that says that
syt([a1,..., ak])= Delta(a1+k-1,a2+k-2, ..., ak)*(a1+...+ak)!/((a1+k-1)!(a2+k-2)!....ak!)
Where Delta(x1,...xk) is the discriminant, i.e the produc of xi-xj over all 1 ≤ i ≤ j ≤ k.
[Hint: Multiply Sc(L,x,m) that you got from Maple, by the Discrimiant Delta(x[1], ..., x[m]), expand, and try to detect a pattern.]
Added April 26, 2021: The students' nice solutions are in this directory
Lecture 26 (Monday, April 26, 2021)
C26.txt ,
Contains procedures
GNW(L): inputs a shape L and outputs a (uniformly at) random Standard Young tableau using the Greene-Nijenhuis-Wilf amazing algorithm
Subject: hw#26
and an attachment
hw26FirstNameLastName.txt
and indicate whether it is OK to post. If you do not say "Please do not post", it will be posted.
Also have your name at the first line
StartShape(Y,k)
That inputs a Standard Young tableau and a positive integer, and outputs the shape of the sub-tableau consisting of {1,2,3,..,k}. For example
StartShape([[1,3,4],[2,5],[6]],4);
should give you [3,1]
EstStart(L,k,K)
that uses GNW(L) K times (K large) and for each of the partitions of k (use Pn(k)) estimates the probability that a random Standard Young tableau of shape L has that starting shape (so the output is a list of length pn(k), corresponding to the frequency of it being the Start Shape with k cells.
What did you get for
EstStart([9$12],5,10000)?
ExatStart(Y,k)
that finds the EXACT values estimated by EstStart(Y,k,K) (for large K)
[Hint: write a procedure sytSkew(L,L1) that finds the number of standard Young tableaux of skew-shape L\L1 (look up Skew-shape)]
Added May 3, 2021: The students' nice solutions are in this directory
Lecture 27 (Thurs., April 29, 2021)
C27.txt ,
Contains procedures
Work on your project. The preliminary draft, hopefully to be expanded during the summer, is due May 10, 2021.
Lecture 28 (Monday, may 4, 2021)
See the lecture
Work on your project. The preliminary draft, hopefully to be expanded during the summer, is due May 10, 2021.
HAVE A GREAT SUMMER! See you in the next edition of this class, Spring 2022.