CSE235

Welcome! Please take a few minutes to learn something

Today's Topic: PERMUTATIONS

A permutation is an ordered arrangement of a distinct set of objects
An r-permutation is an ordered arragngement of r elements of a set

The number of r-permutations of a set with n distinct elements is:
--> P(n,r) = n(n-1)(n-2)...(n-r+1) or ((n!)/((n-r)!))

Let's look at an example to clear things up
ex: imagine you are a thief, and you would like to break into a house
You can't do it at night, because the residents are at home, and busting
through the front door in broad daylight isn't very smart. Let's say you
are one of those rich thieves that doesn't really care what you swipe, so
so long as you swipe something. The next question then is, "Which house
do you steal from?" Obviously, You should prey on those with poor garage
door codes. (assuming there is another door leading inside the house)
You did some researching and you found out that there is a certain brand
of garage doors that has 10 digits (0-9) and an enter key (which lets you
know immediately if your code is right) and the keypad never locks out due
to false combinations. Even better is the fact that this certain keypad
is the kind that makes your choice glow (which means no number is used twice)
when you press it. It's a wonderful world we live in. Anyway, this brand
comes in three different models. model(a) uses a 4-digit code, and costs
$39.95, model(b) uses a 5-digit code and costs $59.95, and model(c) uses
a 6-digit code and costs $89.95. Now a model(a) would be easier to
to compromise but would have meager posessions compared to door #3, I mean
model(c). let's find out just how long each lock would keep us busy.

using the formula above, we find that-
a) n = 10, r = 4; P(10,4) = 10!/6! = 5040 possible combinations
b) n = 10, r = 5; P(10,5) = 10!/5! = 30240 possible combinations
c) n = 10, r = 6; P(10,6) = 10!/4! = 151200 possible combinations

Assuming that on average, a key takes a second to press, how long would
each lock take to crack. (don't forget to include the enter key!)

a) 5040 * 5s = 25200s; 25200s/3600(s/hr) = 7 hours
b) 30240 * 6s = 181440s; 181440s/3600(s/hr) = 50.4 hours
c) 151200 * 7s = 1058400s; 1058400s/3600(s/hr) = 294 hours

(Once you get inside. Shut the garage door and smash the inside door open)
As you can see the model(c) is quite tricky. Especially since there is a
point when you must leave, because Mr. Homeowner has returned. But of course
you don't have that kind of time to waste. I suggest hiring a bum on campus
last time I checked, they worked for cheeseburgers, and viewed jail as upscale
living. Also, please note that I do not condone stealing in any way. It sure
would be fun to rearrange their furniture though. Or put a secret web cam in
there rooms, and then send them the website address in the mail one year later
use your imagination. If you're fast (or they're on vacation) you could even
put a brick wall just inside their garage door. With "THINK FAST" spray
painted on it. Just remember. You are the one breaking the law. Not me.
And this is in no way to be used for a violent crime!!

Alright, let's test your knowledge.

QUIZ