My Love for You Is a Monotonically Increasing…

November 13, 2010 at 09:30 (mathematics, silly)

Just now I ran across a funny question over at Yahoo! Answers on mathematical pick-up lines, and I decided to pick out a few favourites (taken from Y!A and elsewhere):

  • My love for you is a monotonically increasing unbounded function. (I think in order to see this as funny you have to imagine somebody saying it with feeling.)
  • Your beauty cannot be spanned by a finite basis of vectors.
  • I don’t like my current girlfriend. Mind if I do a you-substitution?
  • I wish I were your problem set, because then I’d be really hard, and you’d be doing me on the desk.

Also worthy of mention:

  • Your lab bench, or mine?
  • Your mama’s so fat she has a proper subgroup isomorphic to herself.
  • I’m a fermata… hold me.

Last but not least, there is this gem:

Read the rest of this entry »

Permalink Leave a Comment

Modeling Sequences with Polynomials

November 11, 2010 at 20:10 (math.RA, mathematica)

Suppose I asked you to find the next term in the sequence

2, 4, 6, 8, 10, …

Of course the expected answer is 12. But then I could tell you that these terms correspond with the formula

f(n) = -2 + \frac{197}{30}n - \frac{15}{4}n^2 + \frac{17}{12}n^3 - \frac{1}{4}n^4 + \frac{1}{60}n^5

so the actual sequence has

2, 4, 6, 8, 10, 14, 26, 58, 130, 272, …

This illustrates a common misconception that there is a unique solution to these sorts of problems. In fact, starting with the first five evens, we can pick any real number as the sixth term and find a polynomial of degree at most 5 to model it using some basic linear algebra.

Read the rest of this entry »

Permalink 2 Comments

Frobenius Numbers – Round Robin Algorithm

September 20, 2010 at 14:50 (algorithm, java, math.NT)

Frobenius numbers are solutions to the coin problem. Let \displaystyle 0<a_1<\cdots<a_n be coin denominations; what is the smallest sum of money that cannot be obtained using these coins? More formally, define the Frobenius number \displaystyle g(a_1,\,\ldots\,,a_n) as the greatest number that is not a linear combination \sum_{i=1}^n x_ia_i with \displaystyle 0 \le x_i \in \mathbb{Z} . The Frobenius number exists if and only if \displaystyle a_1 > 1 and \displaystyle \gcd(a_1,\,\ldots\,,a_n)=1 . A special case of Frobenius numbers involves the interestingly named McNugget numbers, and there is a well-known formula when \displaystyle n=2 given by \displaystyle g(a_1,a_2)=a_1a_2-a_1-a_2 sometimes known as the Chicken McNugget Theorem.

Read the rest of this entry »

Permalink Leave a Comment

Clustered k-Subsets

July 11, 2010 at 04:39 (algorithm, java, math.CO)

This post is mostly copied and pasted from my posts in this thread on MHF.

Problem statement: Let \displaystyle S_n = \{1,\ \dots\ ,n\} and let \displaystyle f(n,k,x) be the number of k-subsets of \displaystyle S_n such that when the elements are ordered from least to greatest, the absolute difference of any two adjacent elements is less than \displaystyle x. Find a formula or algorithm to determine \displaystyle f(n,k,x) for arbitrary \displaystyle n,k,x \in \mathbb{Z}, n\ge 0.

Read the rest of this entry »

Permalink Leave a Comment

Continued Fractions of Square Roots – Steps

July 4, 2010 at 19:31 (algorithm, java, math.NT, tutorial)

Everyone knows what continued fractions are, right? Continued fractions have interesting properties and can be used to obtain best rational approximations for real numbers, among other things. Here is an example of a finite continued fraction:

8.309 = 8+\cfrac{1}{3+\cfrac{1}{4+\cfrac{1}{4+\cfrac{1}{3+\cfrac{1}{2+\cfrac{1}{2}}}}}}

Read the rest of this entry »

Permalink Leave a Comment

2×2 Squares on a Randomly Filled m×n Board

June 28, 2010 at 17:03 (algorithm, java, math.PR)

This post, like the last one, is an offshoot of a thread on Math Help Forum. The situation is: Suppose there is an m×n chess-like board and we wish to fill in all the (1×1) squares according to: all squares are either black or white, and the probability that a square is black is p . What is the probability that a randomly filled board will contain at least one 2×2 black square?

Read the rest of this entry »

Permalink Leave a Comment

Blackjack Basic Strategy – Infinite Deck

May 24, 2010 at 06:24 (algorithm, java, math.PR)

I came across a good programming exercise over on this thread at Math Help Forum (I’m “undefined”), and here are the results. This program reproduces the charts and expected value on this page over at The Wizard of Odds for an infinite deck. I realise the code could be cleaner, but I’m pleased with the performance of the underlying algorithms. On my laptop with modest specs, calculation takes about 20 milliseconds.

Read the rest of this entry »

Permalink Leave a Comment