"Pedantically, neither of these phrases are correct"
Pedantically, neither of those sentences are phrases, they are questions.
One of those days. See icon.
At the heart of machine learning are patterns, and patterns are all about counting, so it's important to make sure we are counting the correct items in the correct way. Combinatorics is the branch of mathematics concerned with counting things; more specifically, all the wonderful ways you can count, arrange and manipulate finite …
Combination locks...
Mechanical combination locks such as these...
http://www.codelocks.co.uk/cl200/cl200-surface-deadbolt.html
actually are true combination locks, rather than permutation locks. You can press the buttons for the combination in any order you want (or all together if you insist) and they will unlock.
(not counting the 'C' button which just clears the mechanism rather than being part of the actual combination).
I was quite disappointed to discover that they were not nearly as secure as I had assumed.
The locks have 0..9XYZ characters, so the security of guessing a 5 character code drops from a 1 in 371293 chance to 1 in 1287.
This post has been deleted by its author
This post has been deleted by its author
> You are right, the 8191 figure is derived from summing the combinations from 1 of 13, 2 of 13 through 13 of 13
Although that's correct, it can be done more simply: each button is either "in" or "out" (2 choices), and the correct combination is a unique permutation of ins and outs, so it's just 2^13 - the same as the number of different values of a thirteen-bit binary number.
Minus one to exclude the all-out (all-zeros) combination which would mean your door is unlocked by default.
I was in a high school math class and one of the students asked how many chords on the piano there were (not distinguishing notes an octave apart). The instructor started by calculating 12 single notes plus 12.11/1.2 double notes plus ... . I looked up from the science fiction novel I was reading (I was bored) and said 4096 or 4095 if you don't count silence. The instructor wrote 4095 on the board and continued his computation. When he finally got the (obvious to me) answer he just looked at me and changed the subject. Even in 1960 I was playing with computers and knew powers of two cold but some people are easily impressed.
This post has been deleted by its author
It gets worse.
A lot of people don't change the codes very often, and the action behind keys that are used most tends to soften fairly quickly. There have been times where I've forgotten the combination to a room/building and reminded myself by just prodding all the buttons until I find the soggiest ones, which then let me in. Scarily weak security.
A lot of people don't change the codes very often, and the action behind keys that are used most tends to soften fairly quickly.
Similar problem with electronic locks using a keypad: you can often see the keys in use as having a grimy area around them and/or being more worn, so it's now merely a matter of finding the right permutation of those keys.
I was quite disappointed to discover that they were not nearly as secure as I had assumed.
They look pretty insecure to me in the first place. Before trying any combination you'd rather crack open the whole lock. If you can't figure the combination from the dirt on the right keys, that is.
Anyway, those locks are not really made to secure anything. They are rather there against accidentally opening the wrong door.
It's more common to encounter the flip side of that: people saying "infinite" when they mean "unbounded". For example, a Turing Machine doesn't have infinite tape, it has unbounded tape. It will never use more than a finite portion of it, but there is no upper bound on how large that portion can be.
Phrase/sentence howler - come on Ed.
"You might have heard the words "combination" or "permutation" used in conversation..."
Permutaions and combinations are not news to Reg readers. This isn't the Grauniad.
"...mathematics has a convenient formula for the calculations shown above and you can search the internet for it... "
Or just remember it from school. Not a bad article, despite my sniping. Just told to the wrong people.
"If you're interested, you win the lottery with a combination (not a permutation)"
While this is technically true for most lottery games, it is not true for all. Some "smaller" lottery games (Pick 3 numbers instead of 6, etc) have much smaller payouts but pay a bonus or, in this example, provide the highest payout for the smallest buy-in if you get the winning numbers in the correct order (therefore, permutation)
to talk about how programmers actually code up the selection of a random combination or permutation. You need something like a Fisher-Yates shuffle (using lists) or Floyd's algorithm (using sets) to ensure that the results aren't biased in some way.
It's all to easy to come up with a naive algorithm for, eg, dealing a hand from a deck of cards that seems to work but favours picking certain hands over others.
A pseudo-maths article, that's unusual.
Though the bit I like about perms and combs is that it's a perfect demonstration of factorials. Factorials get out of hand REALLY quickly - 21! won't fit in a 64-bit number, for instance, and just 69! is enough to exceed most calculator's display capacity (even with exponents up to 10^99 and complete loss of accuracy). And something like 449! is an incredibly difficult-to-handle number (> 10^999).
However, nPr and nCr are basically multiples of large factorials (e.g. 49 choose 6 for the lottery: 49! / (6! x 43!) ). But, because of what a factorial is - every number up to itself multiple together - they cancel out really fabulously so you never have to have 1024-bit numbers to work them out.
It's little things like that that make maths beautiful - eliminating the need to do ridiculously large calculations by just using the right notation and a little algebra.
> It's a Shriek (the exclamation mark in that equation)
When I was in school (decades ago) I also heard it called "admiration" -- that is, some people pronounced 3! as "three admiration." I was told that was a British thing (I went to school in the U.S.)... is there any truth to that?
@pdh
I'm British, and I've never heard of it being called "admiration" before. Usually it's named as "exclamation mark", though I have heard it referred to as "bang" (which seemed odd at the time). In a mathematics context people normally just say "factorial" though, seeing as that's what it's actually denoting.
George 3 (the OS, not the mad monarch) would allow you to create temporary work files called !, and these were created in a stack. Create two work files and you could reference one as ! and the other as !-1. Add another and it became ! and the existing ones !-1 and !-2.
For convenience we always called them shriek files, referred to as "shriek" "shriek minus one" etc.
"Factorials get out of hand REALLY quickly - 21! won't fit in a 64-bit number, for instance, and just 69! is enough to exceed most calculator's display capacity (even with exponents up to 10^99 and complete loss of accuracy). And something like 449! is an incredibly difficult-to-handle number (> 10^999)"
Factorial can, for large enough n, be approximated by sqrt(n)*pow(n,n)/exp(n).
pow(n,n) gets very large very quickly. 1, 4, 27, 256, 3125, 46656, 823543, ... In particular, it gets very large much faster than exp(n) (e to the power n).
And the IEEE-754 "long double" (80-byte floating point) can handle exponents of 10 beyond 4900. Of course, modern compilers tend not to support it since SSE floating point is much faster than x87 NPU floating point, and SSE does not understand long double. If you can track down a copy of VC++6, though, you're in business.
Have a UK maths degree.
Have never referred to it as a shriek. Or a bang. Both are quite American, I think. Yes, even in the Unix shell-script !/bin/sh sense, I don't call them shrieks or bangs.
Never heard of the other words used in this thread either.
It's an exclamation mark (if in speech / symbol) or it's a mathematical mark: "x factorial". Or it's possibly "NOT" if used as a logical operator.
The one in UNIX paths, I don't call anything in particular because how often do you have to explain to someone to type in a ! into a shell script who doesn't already know exactly how to do so?
I guarantee that if you try to read out a password with an "!" in it to a random person, they won't understand shriek or bang or pling. But they know what an exclamation mark is. Hell, even "hash" for # confuses people ("Yes, it's the little noughts-and-crosses board" "What's noughts and crosses? You mean Tic-Tac-Toe?" etc... it might be called 'hash' or 'pound' (US) or 'octothorpe' or, to music people 'sharp' but if you choose any one of those when talking to a random person you have about a 50% chance of success - if anything "hashtag" actually works better but I refuse to call the symbol that, and people often don't know what "hash" on its own means).