- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Is anyone else finding the basic stats discussions in this thread extremely disturbing? Especially considering that this is allegedly a site aimed at programmers?
Admin
If you still don't get it, just do it on your fingers.
00,11,22,33,44,55,66,77,88,99,AA,BB,CC,DD,EE,FF
Are all the possible doubles for two hex characters. There are quite clearly 16 duplicates, not 256. If there are a total of 16 possible outcomes(THAT WE CARE ABOUT) And you can only get one of them. Then its a 1 out of 16 chance.
Admin
Admin
You are correct that the chances of getting two sixes in a row is 1/256. However, the chances of getting two identical characters in a row is 1/16.
There are 256 possible combinations of characters. Two sixes in a row is one of those 256 combinations - hence, 1/256. However, there are 16 combinations where the two characters are identical. 00, 11, 22, ..., DD, EE, FF. Thus, there is a 16/256 chance of getting two identical characters. 16/256 reduces to 1/16.
Admin
Was that really necessary?
Admin
Admin
I've been made a fool many times by not knowing what something is or how is works. RTFM. Always.
Admin
OK ok.
But why is the processed set kept with the unprocessed set.
If they were kept separate they could have the same id, making it easy to tell which belongs with which.
Admin
Admin
Admin
For a very brief time I helped a coworker maintain a client's web application. It had a GUID generator routine that simply chose the correct amount of letters/numbers at random and put dashes in the right spots.
I'm hoping that was the only time I'll ever see GUIDs with Xs and Zs in them.
Admin
Hell, are any of the articles on this site really necessary?
Admin
A bit awkward, as if you also need pins for interns etc so it gets a bit tight... Whenever someone's retired or fired, immediately assign their pin to the new employee -- that may be a security concern with recently-fired disgruntlees.
Admin
Heh heh heh. Someone you know knows something you don't know.
Admin
Admin
Admin
Admin
Admin
Admin
Yes, indeed, that was unforgivable. That really was a horrible noise coming from my speakers, quite drowned out Rachmaninov's 1st Suite for 2 pianos (Previn & Ashkenazy).
Admin
Statistics is applied probability theory.
Admin
Admin
Sounds like nothing else that popped up would have been foreign to you. Aren't you a Brit? (why do I bother asking?)
Admin
Oh, you changed the URL. That's absolutely hilarious and clever.
Admin
Admin
Admin
I thought it was funny as hell, even if no one else does.
And no, I'm not clever at all. I still haven't managed to slip ANYTHING past your GeniusMonkey script. Guess I'm just too dumb.
Admin
Admin
Admin
Admin
Do you want me to send a few GUIDs? I have some spare ones.
Admin
Admin
Admin
In vain.
Admin
I like the one where you ask them to calculate the odds when you randomly stuff a hundred letters into a hundred envelopes that only one of the letters gets into the correct envelope.
Then you ask them what the odds are that 99 out of a hundred get into the right envelope.
Admin
Why is this so difficult, people? The probability of a collision is 1/2.
There are 2 possible outcomes of the experiment. Either a) the first to hexadigits are the same, or b) the two hexadigits are different.
One of those 2 outcomes is the one we want to calculate the probability of, so the probability is, by definition 1 out of 2, or 1/2.
Simple math.
Now, does anybody want to buy a lottery ticket from me? They have a winning probability of 1/2 as well. In fact, if you buy 3 tickets, you're assured of a win, since 1/2 + 1/2 + 1/2 > 1.
--Joe
Admin
Admin
Admin
Admin
Admin
Admin
I'm not sure I see the problem...
I can see that the first two characters get swapped, but I don't understand how this makes a difference....viz:
108 109 110 111 112 113
produces: 018 019 110 112 113
still no duplicate....or am I totally missing the point?
Admin
From the fact that I have a sense of humour, I thought that was obvious.
Admin
Admin
Fuck me drunk you're stupid.
Output:
HoHum.
Admin
Well played.
Admin
Obviously, the answer is to interject your own getguid function along the lines of:
def myguid(): ....guid = "aawhatever" ....while guid[0] == guid[1]: ........guid = getGUID() ....return guid
Viola! No duplicate first characters. Of course, it reduces your GUID-space by a fctor of 16 but there's still plenty of them out there, right :-)
Admin
Admin
Admin
I just generated a couple of GUIDs, and I was going to publish them (but never use them myself). Then I realized that someone, or several someones, might use them. Oh well.
Want a random number? 4. Guaranteed to be random.