Clutz
Tells us when we're offset.
- Joined
- Jun 7, 2002
- Posts
- 2,483
- Likes
- 13
Syzygies posted an interesting question in the M3 discussion thread. It caught my attention and I wanted to respond to it, but since it seemed like it was way off topic I made a new thread. The question was essentially, how many resistors (feel free to replace resistors with any electrical bit) does one need to have in their inventory in order to be able to have perfect matching in those parts.. i.e. HOw many 47kOhm resistors does someone need in order to have two of them which are identical to each other, given some maximum % difference we're willing to live with? Syzgies noted that this was a problem similar to the birthday problem, and was entirely correct. For the sake of completeness, I include my initial reply to his post about the Birthday Problem, and then follow on to the more interesting question.
Quote:
Ahh yes the birthday problem, I really like probability theory (and stochastic processes) and this is a really cool bar trick too.
The birthday problem essentially asks, what is the probability that in a group of size N, what is the probability that at least 2 individuals will have the same birthday? The probability is the 365-1/(365) * (365-2)/(365) * (365-3)/365 * .... (365-N+1)/365. (I can explain why this works to anyone who is interested). There is an easy to use equation for this problem which involves using factorials, and it is 365!/((365-N)!*365^N). (Don't bother trying to calculate 365! - I do not know of any calculator that can do it (not icluding software like Mathematica, Matlab, Maple, etc..).. For those who are curious, it's about 2.5*10^616 (about 615 zeros following 25).
Quote:
I may be totally wrong about this- I'm not a statistician or a mathematician- but I think what I say below is correct.
That's a relatively easy problem to solve too (with a few assumptions which are probably not met in the instances you described). You modify the above function to be R!/((R-N!)*R^N), where R is the number of different possible classes of resistors of a particular rating and N is the number of resistors in your collection.
There are two problems with this. The first problem, and it's one you cannot get around - is that it assumes you have a random sample of resistors that can all be called a particular class. e.g. You have not already started taking some resistors out of your collection and started matching them. Once you do this, your sample is no longer random and this approach will no longer work perfectly. In reality, if you have a large enough number of resistors (and I do not know how many resistors is enough)- it probably does't matter TOO much- but the fewer resistors you have, the more it will matter.
The second issue comes in two parts. The first is - how precisely do you wish to have your matches be? Is a 0.1% difference considered identical? 0.01%? That's entirely a decision that has to be left up to the individual. The reason this is important, is that we are going "bin" together resistors that are close enough that we're willing to call them identical.
i.e. is a 47.01kOhm resistor similar enough to a 47.02kOhm resistor to call them identical, but a 47.01kOhm and 47.03kOhm are too different? In this case our "bin" sizes are 0.2kOhm each.
To address this problem we'd need to know the distribution of variance around resistor values produced to have a given resistance. We could probably assume (probably a reasonable assumption) the "error" is normally distributed, in which case we would just need to know what the variance in this is.
We need to do these two things so we can determine the value for R. Once we have R, we can determine how many resistors we need (N) to have 95% (or whatever % you desire) chance of finding two that are identical.
All in all, a very soluable problem - and perhaps one that is interesting enough to get a measure on the variance. I (think) can work out this problem to work for a given amount of variance and precision. It shouldn't be too hard- but I'm not going to bother unless people care.
Cheers,
Clutz
Quote:
Originally Posted by Syzygies There's a famous math problem behind resistor matching: The "Birthday" problem. With 30 people in a room there's likely to be two people with the same birthday. Buy a bag of twenty resistors, there's likely to be an amazing match among two of them. |
Ahh yes the birthday problem, I really like probability theory (and stochastic processes) and this is a really cool bar trick too.

The birthday problem essentially asks, what is the probability that in a group of size N, what is the probability that at least 2 individuals will have the same birthday? The probability is the 365-1/(365) * (365-2)/(365) * (365-3)/365 * .... (365-N+1)/365. (I can explain why this works to anyone who is interested). There is an easy to use equation for this problem which involves using factorials, and it is 365!/((365-N)!*365^N). (Don't bother trying to calculate 365! - I do not know of any calculator that can do it (not icluding software like Mathematica, Matlab, Maple, etc..).. For those who are curious, it's about 2.5*10^616 (about 615 zeros following 25).
Quote:
Originally Posted by Syzygies A more interesting question is what one's high/low inventory levels should be, to always find good enough matches from what's left after years of cherry-picking and restocking. |
I may be totally wrong about this- I'm not a statistician or a mathematician- but I think what I say below is correct.
That's a relatively easy problem to solve too (with a few assumptions which are probably not met in the instances you described). You modify the above function to be R!/((R-N!)*R^N), where R is the number of different possible classes of resistors of a particular rating and N is the number of resistors in your collection.
There are two problems with this. The first problem, and it's one you cannot get around - is that it assumes you have a random sample of resistors that can all be called a particular class. e.g. You have not already started taking some resistors out of your collection and started matching them. Once you do this, your sample is no longer random and this approach will no longer work perfectly. In reality, if you have a large enough number of resistors (and I do not know how many resistors is enough)- it probably does't matter TOO much- but the fewer resistors you have, the more it will matter.
The second issue comes in two parts. The first is - how precisely do you wish to have your matches be? Is a 0.1% difference considered identical? 0.01%? That's entirely a decision that has to be left up to the individual. The reason this is important, is that we are going "bin" together resistors that are close enough that we're willing to call them identical.
i.e. is a 47.01kOhm resistor similar enough to a 47.02kOhm resistor to call them identical, but a 47.01kOhm and 47.03kOhm are too different? In this case our "bin" sizes are 0.2kOhm each.
To address this problem we'd need to know the distribution of variance around resistor values produced to have a given resistance. We could probably assume (probably a reasonable assumption) the "error" is normally distributed, in which case we would just need to know what the variance in this is.
We need to do these two things so we can determine the value for R. Once we have R, we can determine how many resistors we need (N) to have 95% (or whatever % you desire) chance of finding two that are identical.
All in all, a very soluable problem - and perhaps one that is interesting enough to get a measure on the variance. I (think) can work out this problem to work for a given amount of variance and precision. It shouldn't be too hard- but I'm not going to bother unless people care.
Cheers,
Clutz