IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Where did you get 1G?
SSNs are 9 digit numbers. There are a billion possible. You need 10 bytes to store one based on the scheme you mentioned. So you need 10G worst case to store the data.

What is the efficiency of your algorithm. IOW, as n increases, what happens to search time t?

How fast can you grep a 10G file? If its more than a few milliseconds it is too slow.

Having and being able to explain these numbers will get you a second interview. Not having them will get you a 'thanks for your time'. Its not even remotely academic in that environment. You have to do this kind of stuff with all kinds of data. Session ids, customer ids, sku codes, etc.

For fun, generate the file of all possible numbers, then grep 500000000. That's your average. Let me know how long it takes.



[link|http://www.blackbagops.net|Black Bag Operations Log]

[link|http://www.objectiveclips.com|Artificial Intelligence]

[link|http://www.badpage.info/seaside/html|Scrutinizer]
Expand Edited by tuberculosis Nov. 26, 2006, 10:50:05 PM EST
New Not all 9 digit numbers are valid.
As I'm sure you know.

[link|http://en.wikipedia.org/wiki/Social_Security_number|Wikipedia]

Valid SSNs

Currently, a valid SSN cannot have an area number above 772, the highest area number which the Social Security Administration has allocated.[3]

There are also special numbers which will never be allocated:

* Numbers with all zeros in any digit group (000-xx-xxxx, xxx-00-xxxx, xxx-xx-0000).
* Numbers of the form 666-xx-xxxx, probably due to the potential controversy (see Number of the Beast). Though the omission of this area number is not acknowledged by the SSA, it remains unassigned.
* Numbers from 987-65-4320 to 987-65-4329 are reserved for use in advertisements [citation needed].

The Administration publishes the last group number used for each area number. Since group numbers are allocated in a regular (if unusual) pattern, it is possible to identify an unissued SSN that contains an invalid group number. Despite these measures, many fraudulent SSNs cannot easily be detected using only publicly available information.


Thus, at the moment, there are a little less than 772M possible valid SS numbers. Hey, a 22% savings is nothing to sneeze at! :-)

Cheers,
Scott.
(Who would probably answer a question like this by saying: "I'm sure this is a well-known problem that has been solved many times over the last ~ 70 years. Give me a few minutes with Google and I'll get back to you." - because he's not a programmer.)
New I assumed so
but I didn't know what the rules were.

There is also, the obvious 50% optimization. If more than half the numbers are allocated, I only track those that are not. Otherwise I track those that are. Thus my worst case scenario moves to 50% allocated and my memory requirements are potentially cut by half.




[link|http://www.blackbagops.net|Black Bag Operations Log]

[link|http://www.objectiveclips.com|Artificial Intelligence]

[link|http://www.badpage.info/seaside/html|Scrutinizer]
     Steve Yegge (who he? - ed) on Perl - (pwhysall) - (62)
         IRLRPD. (new thread) - (Another Scott)
         He worked for Amazon for many years - (tuberculosis) - (60)
             Well based on that ... - (folkert) - (59)
                 Key factors are - (tuberculosis) - (58)
                     do it all the time - (boxley)
                     I have never had an under spec'd system. - (folkert) - (56)
                         More to the point is will it fit on one machine? - (tuberculosis) - (55)
                             I guess I think to simply. - (folkert) - (22)
                                 You would filewalk for every query? - (crazy) - (18)
                                     RAMFS? -NT - (folkert) - (17)
                                         Doesn't matter - (crazy) - (5)
                                             That would be a radix-search, I think. - (static) - (3)
                                                 Nah, you want a hash - (tuberculosis) - (2)
                                                     I thought a radix search was also O(1). - (static) - (1)
                                                         Gah - my bad - (tuberculosis)
                                             Also, I just thought about your file size - (crazy)
                                         On a 32 bit machine? -NT - (tuberculosis) - (10)
                                             Ever heard of PAE? - (folkert) - (9)
                                                 I'd call that exotic technology -NT - (tuberculosis) - (8)
                                                     No, it is bone stock on everything since the P3 from Intel - (folkert) - (7)
                                                         And AMD? PowerPC? ARM? - (tuberculosis) - (6)
                                                             You said COMMON 32-bit - (folkert) - (5)
                                                                 That kind of weasel won't get you a job - (tuberculosis) - (4)
                                                                     This line of questioning wouldn't get you a candidate for - (folkert) - (3)
                                                                         Whoa - (crazy) - (2)
                                                                             No he got downright rude. -NT - (folkert) - (1)
                                                                                 I'm not trying to be rude - (tuberculosis)
                                 Where did you get 1G? - (tuberculosis) - (2)
                                     Not all 9 digit numbers are valid. - (Another Scott) - (1)
                                         I assumed so - (tuberculosis)
                             something you forgot, what lawyer to hire - (boxley) - (1)
                                 Nah - (crazy)
                             We talked about this one before - (admin) - (6)
                                 We did - he didn't - (tuberculosis) - (5)
                                     Just saying... - (admin) - (4)
                                         But we hardly talk about programming at all anymore - (tuberculosis) - (3)
                                             :-) - (Another Scott) - (2)
                                                 I agree on the eyeballs. - (static)
                                                 I put most of my programming rants on my blog - (tuberculosis)
                             non programmer answer, append a 0,1 or2 - (boxley) - (15)
                                 PICK?!?!?!?!?!?!?!?!?!?!? - (crazy) - (5)
                                     dont knock it until you have tried it, recently -NT - (boxley) - (4)
                                         I've spent the last 20 years systematically killing it - (crazy) - (3)
                                             again, see what the needs are and then ask what the solution - (boxley) - (2)
                                                 One trick pony - (crazy) - (1)
                                                     If that is the trick you need use it -NT - (boxley)
                                 The key is to stay off the disk - (tuberculosis) - (8)
                                     CramFS in RAM. -NT - (folkert) - (6)
                                         That's not a solution either - (tuberculosis) - (5)
                                             Okay, at this point... - (folkert) - (4)
                                                 Sure - just want to give you a taste - (tuberculosis) - (3)
                                                     personally I hate programming, I like debugging - (boxley)
                                                     Cheaper at Bookpool, btw. - (admin)
                                                     ICLRPD - (drewk)
                                     Math isnt my strong suit but - (boxley)
                             I hope you're going to outline the solution. :-) - (Another Scott) - (3)
                                 Admin did it very nicely. - (crazy) - (1)
                                     D'Oh! Thanks. -NT - (Another Scott)
                                 Cool sort paper - (crazy)
                             Taking a stab - (ChrisR) - (2)
                                 Still doesn't beat O(1) :-) -NT - (admin) - (1)
                                     Ok, I read the answer you gave... - (ChrisR)

Gimme some sugar, baby.
143 ms