Tuesday, February 03, 2015

Comparing rectangles by their area and by their diagonal

The other day I was in someone’s office waiting for some paperwork to be completed.
It was a small room, about 12 feet by 12 feet.
The back wall was orange, and its lower part was horizontally covered by a desk.
In the middle of the orange wall there was a picture of a green car. I thought that was an interesting color combination.
Looking at the picture on the wall, I wondered how bigger the visible part of the wall (including the picture) was, in area, in relation to the area of the picture.
The horizontal length of the wall was about two-and-a-half times the length of the picture, while the hight of the visible part of the wall was about three times the height of the picture.
Putting

b = length of the picture

h = height of the picture
a = area of the picture
B = length of the wall
H = height of the visible part of the wall
A = area of the visible part of the wall (including the picture)

we have, approximately


B = 5b/2, and H = 3h


therefore


A = BH = (5b/2)(3h) = 15bh/2 = 15a/2


So the proportion between those two areas is 15/2, 0r 7.5


Then I wondered what the proportion would be between the diagonals of those same two rectangles. As it turns out, when the two rectangles (the wall and the picture) do not have the same shape, the proportion between their diagonals depends not only on how many times the sides of the wall are on relation to the sides of the picture, but on the precise shape of the reference rectangle, as well.

If we use

d = measure of the picture’s diagonal

D = measure of the diagonal of the visible part of the wall

Then we have


D = sqrt(B2 + H2)

 = sqrt((5b/2)2 + (3h)2)
 = sqrt(25b2/4 + 9h2)

while


d = sqrt(b2 + h2)


The coefficients of b2 and h2 inside the square root in the expression for D are not the same, so we cannot simplify that expression completely just in terms of d.


If we introduce a new constant, k, to represent how many times the height of the picture equals its length, then we can write


b = kh


In that case, the diagonals of the two rectangles can be expressed as


d = sqrt((kh)2 + h2)  =

 = sqrt(k2•h2 + h2) = 
 = h•sqrt(k2 + 1)

D = sqrt(25(kh)2/4+ 9h2) = 

 = sqrt(25k2h2/4 + 9h2) = 
 = h•sqrt(25k2/4 + 9)

This shows the proportion between D and d being dependent on k, the proportion between h and b, because


D/d = sqrt(25k2/4 + 9) / sqrt(k2 + 1) 

and this is a function of k that is not constant.

Sunday, February 01, 2015

A very cool property of binomial coefficients

Last night I was reading a post in this other blog, by Ben Vitale. His post is about some special types of binomial coefficients.

In case you don’t remember, given two non-negative integers m and r, their binomial coefficient  C(m,r) (also known as “m chose r”) counts the number of subsets of size r out of a set of size m, and it is calculated by the formula:

C(m,r) = m!/(r!•(m-r)!)

In particular, when r=2, we get

C(m,2) = m!/(2!•(m-2)!) = m(m-1)/2

This is an expression for counting the number of all possible unordered pairs formed by two elements of a set of size m.
Somewhere near the end of his post, Ben presents the following formula:

C(kn,2) = k•C(n,2) + (1/2)•(k-1)k•n2

On seeing this formula, I noticed the second term on the right-hand side,

(1/2)•(k-1)k•n2

can be rewritten using the binomial coefficient C(k,2), producing the expression

C(kn,2) = k•C(n,2) + C(k,2)•n2

This formula holds true for any two positive integers n and k, each greater than 1.
In particular, by using the trick of swapping n with k in that expression, we get the following one:

C(nk,2) = n•C(k,2) + C(n,2)•k2

Now, multiplication being commutative, we know kn = nk.

Therefore, C(kn,2) = C(nk,2)

And we can connect their two equivalent expressions, making this formula:

 k•C(n,2) + (n2)•C(k,2) = (k2)•C(n,2) + n•C(k,2)

I don’t know about you but I believe this is just amazing!
Let’s illustrate this property with a couple examples:

a) First, we choose two numbers, let’s say n=5 and k=7

b) Then we calculate their squares: 52 = 25, and 72 = 49

c) Now we calculate their binomial coefficients for 2:

C(5,2) = 5•4/2 = 20/2 = 10
C(7,2) = 7•6/2 = 42/2 = 21

d) Now we plug the numbers into the formula, and verify it:

7•C(5,2) + 25•C(7,2) = 49•C(5,2) + 5•C(7,2)

(7)(10) + (25)(21) = (49)(10) + (5)(21)

70 + 525 = 490 + 105

595 = 595

Let’s check some other numbers, for example n=8 and k=14

Their squares are 82 = 64, and 142 = 196

Their binomial coefficients with 2 are:

C(8,2) = 8•7/2 = 28
C(14,2) = 14•13/2 = 91

and we verify:

14•C(8,2) + 64•C(14,2) = 196•C(8,2) + 8•C(14,2)

(14)(28) + (64)(91) = (196)(28) + (8)(91)

392 + 5824 = 5488 + 728

6216 = 6216

The reason I like this property so much is because both expressions

k•C(n,2) + (n2)•C(k,2)

and

(k2)•C(n,2) + n•C(k,2)

are linear combinations of the same two binomial coefficients. These linear combinations have different coefficients:

k and n2 in one case, and k2 and n, in the other.

In principle, right off the bat, I would not expect them to turn out equal but they are, every single time! What is more, the only change in the coefficients is that you move the square (the exponent 2) from k to n, and viceversa.
I find all this to be pretty cool. I wanted to share it with you, and many thanks to Ben Vitale for his blog post.