Click here to Skip to main content
15,915,019 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: ask for a algorithm about visit array Pin
Dexterus21-Apr-08 0:06
Dexterus21-Apr-08 0:06 
GeneralRe: ask for a algorithm about visit array Pin
CPallini21-Apr-08 8:22
mveCPallini21-Apr-08 8:22 
GeneralRe: ask for a algorithm about visit array Pin
richardye21-Apr-08 14:20
richardye21-Apr-08 14:20 
QuestionRe: ask for a algorithm about visit array Pin
CPallini21-Apr-08 21:33
mveCPallini21-Apr-08 21:33 
GeneralRe: ask for a algorithm about visit array Pin
Member 419459321-Apr-08 18:07
Member 419459321-Apr-08 18:07 
GeneralA Formula Pin
mehrdadc4816-Apr-08 9:37
mehrdadc4816-Apr-08 9:37 
GeneralRe: A Formula Pin
cp987616-Apr-08 14:22
cp987616-Apr-08 14:22 
GeneralAssigning random lives: an algorithm Pin
DQNOK15-Apr-08 13:15
professionalDQNOK15-Apr-08 13:15 
I need to take an existing populations of items (say for example, light bulbs, each bulb having a different number of existing hours already on it) and randomly assign an "expected life" to each item. This assumes I already have a valid PDF (Probability Density Function) from which to assign expected lives for NEW items. The problem is that the items in my population are not new. If I randomly generate a life from the PDF expecting to assign that life to an existing item, and that life happens to be less than the current ACTUAL life of the item, I'm hosed! I can't just ignore that life because then I'm skewing the PDF used to assign the lives.

I'm sure this is probably a no-brainer to a skilled statistician, but I don't recall anything like this in school, and haven't been able to find anything in books or in the limited Google'ing I've done.

Following is an algorithm I came up with while pondering the problem. Any thoughts?
-----------------------------------------

Here is a procedure for assigning "expected lives" to an existing population,
given the PDF parameters for lives of "new" parts.


Here's the scenario. We have a (assumed or tested) PDF for how long NEW parts
last. We have an existing population of parts that have accrued a given number
of hours. We want to use the PDF parameters to randomly assign expected lives
to all the items in the existing population.


Given the existing population's age, we should be able to "overlay" this with
the "known" PDF and determine how many of the initial population have already
failed. Here's an example:
Suppose we have a light bulb that has made it to the 99'th percentile of life.
Since only 1% of bulbs make it to this point, and we've got that bulb in our
hands, clearly 99 other bulbs have already failed, or, there must have been
an initial population of 100 light bulbs. Thus, by having one light bulb at
the 99'th percentile, we can infer that our initial population must have been
100. Now suppose that we have two bulbs, both at the 99'th percentile of
life. Obviously our initial population was 200 bulbs. 200 * (1-0.99) = 2.
Or, 200 = 2/(1.0 - 0.99)
Or, 200 = 1/(1.0 - 0.99) + 1/(1.0 - 0.99)
Basically, each non-failed part infers its own initial population of parts
that must have existed in order to produce this single non-failed part.

Tn = Total of all initial populations =
sum over all parts 'i'( 1/(1 - probability of past failure(age of part 'i')))


Based on the population PDF parameters, we now generate Tn random "lives" and
put them into a blind pot.

Beginning with the oldest item in the existing population (this assures we
don't end up with an item older than any values in the pot, and are thus
"stuck"), we randomly grab an age 'PA' from the pot. If the item's current
age exceeds PA, we put PA back into the pot, and try randomly picking another
age from the pot. Otherwise, we remove PA from the pot and assign it to the
item's "expected life". Then we move on to the next item. When we are done,
the lives left in the pot are the lives of the items that have failed before
this point in time. They get ignored.

David
---------
Empirical studies indicate that 20% of the people drink 80% of the beer. With C++ developers, the rule is that 80% of the developers understand at most 20% of the language. It is not the same 20% for different people, so don't count on them to understand each other's code.
http://yosefk.com/c++fqa/picture.html#fqa-6.6

---------

GeneralRe: Assigning random lives: an algorithm Pin
Alan Balkany16-Apr-08 4:33
Alan Balkany16-Apr-08 4:33 
GeneralRe: Assigning random lives: an algorithm Pin
DQNOK16-Apr-08 5:53
professionalDQNOK16-Apr-08 5:53 
GeneralRe: Assigning random lives: an algorithm Pin
Alan Balkany16-Apr-08 6:03
Alan Balkany16-Apr-08 6:03 
GeneralRe: Assigning random lives: an algorithm Pin
DQNOK16-Apr-08 6:07
professionalDQNOK16-Apr-08 6:07 
GeneralRe: Assigning random lives: an algorithm Pin
DQNOK16-Apr-08 6:24
professionalDQNOK16-Apr-08 6:24 
Generalgenerating random values from a PDF: GOT IT. [modified] Pin
DQNOK16-Apr-08 7:36
professionalDQNOK16-Apr-08 7:36 
GeneralRe: Assigning random lives: an algorithm Pin
DQNOK16-Apr-08 6:02
professionalDQNOK16-Apr-08 6:02 
Generalhamilton algorithm Pin
phap12-Apr-08 4:17
phap12-Apr-08 4:17 
GeneralRe: hamilton algorithm Pin
soap brain12-Apr-08 4:51
soap brain12-Apr-08 4:51 
QuestionRe: hamilton algorithm Pin
CPallini12-Apr-08 5:42
mveCPallini12-Apr-08 5:42 
GeneralRe: hamilton algorithm Pin
soap brain12-Apr-08 5:48
soap brain12-Apr-08 5:48 
GeneralRe: hamilton algorithm Pin
phap12-Apr-08 6:52
phap12-Apr-08 6:52 
GeneralRe: hamilton algorithm Pin
pmarfleet12-Apr-08 8:07
pmarfleet12-Apr-08 8:07 
GeneralRe: hamilton algorithm Pin
73Zeppelin22-Apr-08 1:03
73Zeppelin22-Apr-08 1:03 
GeneralRe: hamilton algorithm Pin
soap brain22-Apr-08 1:06
soap brain22-Apr-08 1:06 
GeneralRe: hamilton algorithm Pin
73Zeppelin22-Apr-08 1:33
73Zeppelin22-Apr-08 1:33 
GeneralRe: hamilton algorithm Pin
soap brain22-Apr-08 1:58
soap brain22-Apr-08 1:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.