Probability of Duplicate Identifiers in a Set of Components

  • Thread starter Thread starter DaanV
  • Start date Start date
  • Tags Tags
    Probability
Click For Summary

Homework Help Overview

The discussion revolves around the probability of duplicate identifiers in a set of components, specifically focusing on how to assign unique identifiers to C components using N available identifiers. The original poster seeks to understand the likelihood of having duplicate identifiers and the conditions under which this probability can be minimized.

Discussion Character

  • Exploratory, Assumption checking, Conceptual clarification

Approaches and Questions Raised

  • Participants discuss the probability of assigning identifiers without duplication, with initial attempts focusing on the assumption that N is significantly larger than C. Questions arise regarding the implications of this assumption and how it affects the probability calculations.
  • One participant introduces the concept of loading (L) and explores the relationship between the number of identifiers and the uniqueness of assignments, questioning the validity of using a Poisson distribution for this scenario.
  • Another participant raises concerns about the independence of probabilities in the assignment process and suggests a simpler question to clarify the problem.

Discussion Status

The discussion is ongoing, with participants providing feedback and exploring various interpretations of the problem. Some guidance has been offered regarding the assumptions made, and there is an acknowledgment of the complexity involved in determining the conditions for achieving a high probability of unique identifiers.

Contextual Notes

Participants are operating under the constraints of needing to assign identifiers in a way that minimizes duplicates, with specific interest in achieving at least 99% uniqueness. The discussion includes considerations of how to model the problem mathematically and the implications of different assumptions on the outcomes.

DaanV
Messages
26
Reaction score
0
Mod note: Removed "Basic calculus" from thread title, as the question doesn't seem to have anything to do with calculus

Homework Statement


Real world kind of thing.

Assume I have a set of C components that I want to investigate.
I want to give each component a unique identifier. I have N identifiers.

What is the probability of having two components with the same identifier (duplicate), given N and C?

Homework Equations


What I'm looking for!

The Attempt at a Solution


So let's say one component gets some identifier. The probability that none of the other components get the same identifier would be:
(1- 1/N)C, assuming N>>C (how much bigger would N have to be than C for this to be a valid assumption, btw?)

However, by my logic this doesn't yet exclude the possibility that any of the other components have duplicate identifiers to one another. This is where I'm getting stuck.

Thanks in advance for any help provided!
 
Last edited by a moderator:
Physics news on Phys.org
DaanV said:

Homework Statement


Real world kind of thing.

Assume I have a set of C components that I want to investigate.
I want to give each component a unique identifier. I have N identifiers.

What is the probability of having two components with the same identifier (duplicate), given N and C?

Homework Equations


What I'm looking for!

The Attempt at a Solution


So let's say one component gets some identifier. The probability that none of the other components get the same identifier would be:
(1- 1/N)C, assuming N>>C (how much bigger would N have to be than C for this to be a valid assumption, btw?)

However, by my logic this doesn't yet exclude the possibility that any of the other components have duplicate identifiers to one another. This is where I'm getting stuck.

Thanks in advance for any help provided!

You might want to look at this. https://en.wikipedia.org/wiki/Birthday_problem
 
  • Like
Likes   Reactions: DaanV
Well.. That just goes to show I should probably dive into Wikipedia first next time. :)
Thanks for your help, that solved it perfectly.
 
DaanV said:
I want to give each component a unique identifier.
If the "birthday solution" applies, then didn't you mean, "I want to give each component a randomly chosen identifier"?
 
Sorry, yes, I do suppose I meant that.
More completely:
"I am giving each component a randomly chosen identifier. I would like to give each component a unique identifier. How can I determine the number of unique identifiers N, so that I have at least 99% odds of having no duplicate identifiers?"

I think I have that figured out though. Thanks for clearing it up. :)
 
Thread revival!

So I’ve been mulling this one over a bit more. I have come to the conclusion that the previous answer, although correct, actually wasn’t what I was looking for. The requirement of X% odds of having zero duplicates is too stringent for my application. So please allow me to introduce a new (and entirely related!) problem.

Mind you, I think I have the correct answer. I’m asking for feedback on if I’m making stupid assumptions. So here goes, thanks in advance!

Homework Statement


Real world kind of thing.

Assume I have a set of C components that I want to investigate.
I am giving each component a random identifier. I have N identifiers.
The ‘loading’ (L) is the average number of components per identifier.
(e.g. if there are 500 components and 100 identifiers, L=C/N=5)

The problem:
How small must L be (or how much greater the number of identifiers than the number of components) for >= 99% of components to be assigned to a unique identifier?

Homework Equations


The partitioning of components into identifiers is described by a Poisson distribution (assumption! Is this likely to be correct?), where P(k;L) is the probability for there to be k components in one identifier given an average loading L.
##P(k;L) = \frac{L^k*e^{-L}}{k!}##

The Attempt at a Solution


Fraction of identifiers with exactly one component assigned to them is
##P(1;L) = \frac{L^1*e^{-L}}{1!} = L * e^{-L}##

To get number of identifiers with exactly 1 component (N1), multiply by N
##N1 = N * L * e^{-L} = C * e^{-L}##

The number of identifiers with exactly 1 component corresponds to the number of components that are uniquely assigned to an identifier (N1 = Cunique). The percentage of components uniquely assigned to an identifier is then given by
##\frac{Cunique}{C} = e^{-L}##

So that the critical value of 99% unique is obtained when:
##L = -ln(0.99) = 0.01005## components/identifier
In other words, as long as there are at least ~100x as many identifiers as components, I can expect 99% of the components to be uniquely assigned to an identifier.

Is this correct?
The outcome looks.. surprisingly simple. Did I overlook something somewhere? Did I take a tremendous detour to get to this answer?
Thanks in advance for taking the time!

Regards, DaanV
 
DaanV said:
Thread revival!

So I’ve been mulling this one over a bit more. I have come to the conclusion that the previous answer, although correct, actually wasn’t what I was looking for. The requirement of X% odds of having zero duplicates is too stringent for my application. So please allow me to introduce a new (and entirely related!) problem.

Mind you, I think I have the correct answer. I’m asking for feedback on if I’m making stupid assumptions. So here goes, thanks in advance!

Homework Statement


Real world kind of thing.

Assume I have a set of C components that I want to investigate.
I am giving each component a random identifier. I have N identifiers.
The ‘loading’ (L) is the average number of components per identifier.
(e.g. if there are 500 components and 100 identifiers, L=C/N=5)

The problem:
How small must L be (or how much greater the number of identifiers than the number of components) for >= 99% of components to be assigned to a unique identifier?

Homework Equations


The partitioning of components into identifiers is described by a Poisson distribution (assumption! Is this likely to be correct?), where P(k;L) is the probability for there to be k components in one identifier given an average loading L.
##P(k;L) = \frac{L^k*e^{-L}}{k!}##

The Attempt at a Solution


Fraction of identifiers with exactly one component assigned to them is
##P(1;L) = \frac{L^1*e^{-L}}{1!} = L * e^{-L}##

To get number of identifiers with exactly 1 component (N1), multiply by N
##N1 = N * L * e^{-L} = C * e^{-L}##

The number of identifiers with exactly 1 component corresponds to the number of components that are uniquely assigned to an identifier (N1 = Cunique). The percentage of components uniquely assigned to an identifier is then given by
##\frac{Cunique}{C} = e^{-L}##

So that the critical value of 99% unique is obtained when:
##L = -ln(0.99) = 0.01005## components/identifier
In other words, as long as there are at least ~100x as many identifiers as components, I can expect 99% of the components to be uniquely assigned to an identifier.

Is this correct?
The outcome looks.. surprisingly simple. Did I overlook something somewhere? Did I take a tremendous detour to get to this answer?
Thanks in advance for taking the time!

Regards, DaanV
That's not really valid because the probabilities of how many get assigned to a given label are not independent.
Also, you seem to be missing a parameter. You want the probability that 99% are unique.

This is quite a hard problem. Let's start with a simpler question. Given R distinct objects and N distinct buckets, how many ways are there of assigning objects to buckets such that no bucket gets exactly one object?
Do you know the principle of inclusion and exclusion?
 
  • Like
Likes   Reactions: DaanV
Thinking about this some more, I suggest making an approximation appropriate to the question asked.
Since you are interested in the case where there are very few duplicates, the probability of three or more getting the same label is vanishingly small.
So consider this:
r distinct objects are placed in n distinct buckets. In how many ways can t <= r/2 buckets get exactly two, and no bucket get more than two?
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 69 ·
3
Replies
69
Views
10K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K
Replies
29
Views
3K
Replies
10
Views
11K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
5K