Monthly Archives: November 2012

Propositions, predicates and quantifiers

(1) Mathematica implements the quantifiers and as the functions ForAll and Exists. For example, ForAll[x, x<1] produces the output . Note that this is simply a quantified statement – it is a statement in the predicate calculus. The predicate “” … Continue reading

Posted in Uncategorized | Leave a comment

Union and intersection of sets

Specifics: (1) The region can be plotted using the Mathematica command RegionPlot: A=RegionPlot[1/4 <= x^2 + (2 y)^2 <= 1, {x, -1, 1}, {y, -1, 1}] We can change the color and make it translucent by adding a couple of … Continue reading

Posted in Uncategorized | Leave a comment

Question 4. Generating primes

Background. The recursively defined sequence a(n)=a(n-1)+GCD(n,a(n-1)), a(1)=7 has the remarkable property that the difference g(n):=a(n)-a(n-1), n>1 is either 1 or a prime number: A NATURAL PRIME-GENERATING RECURRENCE _ROWLAND Specifics: For successive values of the integer n, compute the number dp(n) … Continue reading

Posted in Uncategorized | Leave a comment

Question 3. Fibonacci numbers

The Fibonacci numbers are determined by the following recursive relation: Use Mathematica to calculate and plot f[0]:=1; f[1]:=1; f[n]=f(n-1)+f(n-2); T=Table[{n,f (n)/f},{n,0,50}]; ListPlot[T] Estimate the growth rate of The exponential growth rate is growing fast as same value of n. So, … Continue reading

Posted in Uncategorized | Leave a comment

Question 2. Dijkstra’s fusc function

Background fusc(n) = fusc(n/2) if n is even, and fusc(n ) = fusc((n-1)/2) + fusc((n+1)/2) if n is odd, with fusc(0) = 0 and fusc(1) = 1. Plot fusc(n) as a function of n up to 10,000 Plot a table of values of fusc(n) alongside n for n up to 99. … Continue reading

Posted in Uncategorized | Leave a comment

Question 1. The central binomial coefficent

The binomial coefficients are defined recursively as follows: for all integers n,k>0 for all integers for all integers plot the central binomial coefficient as a function of for bc[n_,k_]:=bc[n,k]=bc[n-1,k-1]+bc[n-1,k]; bc[n_,0]:=bc[n,0]=1; bc[0,k_]:=bc[0,k]=If[k>0,0,1]; A=Table[{n,bc[2*n,n]},{n,0,25}]; ListLogPlot[A,Filling->Axis] Find upper bounds for, or determine, the … Continue reading

Posted in Uncategorized | Leave a comment

Propositions, predicates and quantifiers

(1) Mathematica implements the quantifiers and as the functions ForAll and Exists. For example, ForAll[x, x<1] produces the output . Note that this is simply a quantified statement – it is a statement in the predicate calculus. The predicate “” … Continue reading

Posted in Uncategorized | Leave a comment