Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


probability of automatic swearing?

Reply to topic
Bike Chat Forums Index -> The Geek Zone
View previous topic : View next topic  
Author Message

karoshi
Brolly Dolly



Joined: 28 Jun 2006
Karma :

PostPosted: 14:30 - 23 Aug 2013    Post subject: probability of automatic swearing? Reply with quote

Probability question based on something that just happened on an IT system at work.. can anyone with a statistical leaning help me work through this:

The IT System in question's website has an automated "i forgot my password, please reset it" function, it resets the password to a random 10 digit string of alphanumeric characters - acceptable characters are A-Z and 0-9 (so 36 options for each space in total)

Can anyone tell me, or show me how to work out, what the chance is that the automated process would place a certain 4 Letter word somewhere within the 10 digit string?

I'm getting stuck thinking about the number of possible starting places in the string and the probability of each letter in turn.. e.g. if the word is "DUCK" there's 7 places in the 10 letter string that the "D" could turn up at a 1-in-36 probability, then a 1-36 chance of "U" turning up next, then 1-36 of a "C" and so on?

So, is it 1 chance in (36 x 36 x 36 x 36) over 7?


(7 because there's 7 places that the "D" could appear with enough space left in the 10 digit string for the other three letters)

Shocked
____________________
Well, I've wrestled with reality for 35 years, Doctor, and I'm happy to state I finally won out over it. - Elwood P. Dowd
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

lukamon
World Chat Champion



Joined: 18 May 2007
Karma :

PostPosted: 23:28 - 23 Aug 2013    Post subject: Reply with quote

isn't it 7/36 x 1/36 x 1/36 x 1/36?
____________________
killa wrote: Im an ass man myself
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

ScaredyCat
World Chat Champion



Joined: 19 May 2012
Karma :

PostPosted: 22:47 - 25 Aug 2013    Post subject: Reply with quote

Just md5 the new password word, chop the md5 to 10 characters. Make that the password.

No need to faff about..
____________________
Honda CBF125 ➝ NC700X
Honda CBF125 ↳ Speed Triple
 Back to top
View user's profile Send private message You must be logged in to rate posts

stinkwheel
Bovine Proctologist



Joined: 12 Jul 2004
Karma :

PostPosted: 23:09 - 25 Aug 2013    Post subject: Reply with quote

I think that's the chance of all those letters turning up in the string.

The chance of them all turning up in that order and sequentially is massively less.

But do remember, the chances of it coming out in the next string is exactly the same as the chances of it coming out in the first one.

There are 3,656,158,440,062,975 possible passwords using base 36 to 10 digits
____________________
“Rule one: Always stick around for one more drink. That's when things happen. That's when you find out everything you want to know.
I did the 2010 Round Britain Rally on my 350 Bullet. 89 landmarks, 3 months, 9,500 miles.
 Back to top
View user's profile Send private message You must be logged in to rate posts

karoshi
Brolly Dolly



Joined: 28 Jun 2006
Karma :

PostPosted: 20:30 - 26 Aug 2013    Post subject: Reply with quote

I was along the same lines as Lukamon I think, but I was trying to work out if I should be multiplying the percentages onto each other as it goes.. i.e.

chances of getting a "D" in a useful place is 7/36

chances of getting a "U" in a useful place is 7/36 x 1/36 (chance of having a "D" in front of it)

chances of getting a "C" in a useful place is 7/36 x 1/36 x 1/36

chances of getting a "K" in a useful place is 7/36 x 1/36 x 1/36 x1/36

which would be..

(7/36) x (7/36 x 1/36) x (7/36 x 1/36 x 1/36) x (7/36 x 1/36 x 1/36 x 1/36)

uh.. something around 1 in 37 billion?..
____________________
Well, I've wrestled with reality for 35 years, Doctor, and I'm happy to state I finally won out over it. - Elwood P. Dowd
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

Lurkio
L Plate Warrior



Joined: 15 Dec 2012
Karma :

PostPosted: 20:40 - 26 Aug 2013    Post subject: Reply with quote

karoshi has worked it out correctly and he and lukamon have given the correct answer: 7/36^4 or about 1 in 240,000.

The chance of the occurrence of all letters of a particular four-letter word in any order is 10!/4!6!*36^4, i.e. thirty times that of the word or about 1 in 8000.

Would you give more details of the circumstances OP? Questions in probability that are worded only subtly differently can have very different answers.

EDIT: No you had it right first time.
EDIT 2: I had neglected repetitions. See my later post.


Last edited by Lurkio on 17:40 - 27 Aug 2013; edited 1 time in total
 Back to top
View user's profile Send private message You must be logged in to rate posts

karoshi
Brolly Dolly



Joined: 28 Jun 2006
Karma :

PostPosted: 09:53 - 27 Aug 2013    Post subject: Reply with quote

Hi Lurkio,

exact situation is that;

- a website system that we use at work has an automated "i forgot my password" reset system, the user clicks a button and the site creates and emails them a randomised new password.

- rules for creation of the password are that it has to be 10 characters long and made up entirely of alphanumeric the characters: abcdefghijklmnopqrstuvwxyz0123456789

- this system has been running for two years and last week generated a password for a user that within its 10 letters contained a specific 4-letter word, e.g:

"xxxxPUNTxx"

- so my question is, what was the chance of that specific 4-letter word appearing anywhere within in a randomised 10-letter string?

my first thoughts were that there are 7 places where the 4-letter word could appear, from "PUNTxxxxxx" to "xxxxxxPUNT"

I figure that the chance of a specific letter appearing in any position in the string is 1/36, and there's 7 chances for a relevant letter to appear in a relevant place (so I possibly have to divide the whole thing by 7?), but I can't work out how to convert that into a "x in y" probability figure.

And I'm getting hung up on the idea that aside from the basic probability of each letter appearing, do I also have to figure into it the probability that each letter appears after the relevant letter in the string - i.e. there's a 1 in 36 chance of getting the "U" but only a 1 in 36 chance that it's preceded by a "P", and so on?
____________________
Well, I've wrestled with reality for 35 years, Doctor, and I'm happy to state I finally won out over it. - Elwood P. Dowd
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

Lurkio
L Plate Warrior



Joined: 15 Dec 2012
Karma :

PostPosted: 17:35 - 27 Aug 2013    Post subject: Reply with quote

You have the right approach. Breaking the problem into steps should simplify it.

Suppose 'scvm' is our rude word. There is a 1/36 chance that a generated password starts with 's'. There is also a 1/36 chance that any password has 'c' as its second character. Since the first and second characters are chosen independently of each other there is a 1/36 * 1/36 chance that a generated password starts with 'sc'. Continuing this way gives a chance of 1/36^4 for 'scvm' to start the password. There are 7 places to start 'scvm' in a password each with the same probability so we add these to give 7/36^4.

But wait, there's more! If our password is 'scvm??scvm' we have counted each occurrence of 'scvm'. To find how much we have overshot the mark we proceed much as before. In the 1/36^4 proportion of cases with 'scvm' at the beginning of the password there is a 3/36^4 chance of a repetition; in the 1/36^4 proportion of cases with 'scvm' starting at the second character there is a 2/36^4 chance; in the 1/36^4 proportion of cases with 'scvm' starting at the third character there is a 1/36^4 chance. If take these from 7/36^4 we get the correct answer. (There is no chance of repetition if 'scvm' starts at the fourth character. We leave the later starts to cover all the repeated swearing.) So the probability is (7/36^4) - (1/36^4)(1/36^4)(3 + 2 + 1). This is about 1/240000. (As you might have guessed the chance of repetition is so small it is insignificant. If we had used 'twit' as our word and taken the overlap 'twitwit' as two occurrences there would have been a greater although still negligible effect.)

So we have a 1 in 240000 chance of the appearance of 'scvm' as a substring in a randomly generated password. Is 'scvm' a special word? What if 'wang' or 'gash' had assaulted your colleague's eyeballs? The chance of a rude four-letter word's appearance is much higher than the chance of a particular one's; how much depends on the words you take to be swearing (and would be a ball-ache to determine precisely though may be estimable). Another thing to consider is that this system has been in use for a long time. Presumably many passwords have been generated without causing offence. Given enough goes somebody is bound to get lucky. (If instead the generator is spitting out obscenities willy-nilly then mischief seems likely.)
 Back to top
View user's profile Send private message You must be logged in to rate posts
Old Thread Alert!

The last post was made 12 years, 319 days ago. Instead of replying here, would creating a new thread be more useful?
  Display posts from previous:   
This page may contain affiliate links, which means we may earn a small commission if a visitor clicks through and makes a purchase. By clicking on an affiliate link, you accept that third-party cookies will be set.

Post new topic   Reply to topic    Bike Chat Forums Index -> The Geek Zone All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: birks (www) - Page Generation Time: 0.15 Sec - Server Load: 3.6 - MySQL Queries: 13 - Page Size: 60.32 Kb