Message Boards Message Boards

1
|
2890 Views
|
5 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Combinations probability problem

Posted 2 years ago

Dear Wolfram People,

I was looking for an active forum where I could ask a probability question which would help me in my work. This simple type of task doesn't seem to be at the level that you engage but I'm wondering if anyone would take pity on me and give a quick answer.

There are 17,576 possible combinations of 3 letters (from the 'western' alphabet). If I already have 45 of those combinations, and another 3 letter combination is randomly generated, what is the likelihood of that randomly generated 3 letter combination having 2 of the same 3 letters of one of the 45 combinations I already have?

This is not a trivial matter. I am reporting on a investigation into some missing stock in my organisation and am looking into the possibility of small miscodings in asset serial numbers being behind apparent asset losses.

Anyone fancy helping...real quick?

Damien (working in Rwanda)

POSTED BY: Damien Gregory
5 Replies

Not an answer, but I think you overestimate the space of possibilities. If you restrict to the set of stock abbreviations you believe you have, then the range to consider consists of all cases where one of the three letters is altered. So 75 possible such alterations per stock owned. This assumes I understand correctly the problem you need to solve.

POSTED BY: Daniel Lichtblau
Posted 2 years ago

Thanks Daniel for your comment. I have records of stock with their serial numbers which appear missing. Therefore, I want to look at the possibility that some of the stock is not missing but there has been some misrecording of serial numbers which may mean that the missing stock is not actually missing but is in the list of verified stock under a different serial number (eg with one digit difference between the serial numbers). We have had issues of misrecording serial numbers.

POSTED BY: Damien Gregory

You can try a simulation. Here are 45 given combinations:

givenSample = RandomChoice[Alphabet[], {45, 3}]

Here I assume that you are interested in the matching of 2 consecutive letters:

subSequencesOf2LettersConsecutive = 
 Union[Map[Rest, givenSample], Map[Most, givenSample]]
shares2lettersQ[{a_, b_, c_}] := 
 MemberQ[subSequencesOf2LettersConsecutive, {a, b} | {b, c}]

Here I run the simulation:

sampleSize = 10000;
randomTriplets = RandomChoice[Alphabet[], {sampleSize, 3}];
results = Map[shares2lettersQ, randomTriplets];
Count[results, True]/sampleSize // N

I get a probability of 23%. You may have to adapt the code to your own assumptions.

POSTED BY: Gianluca Gorni
Posted 2 years ago

Hi Gianluca It is very kind of you to run a simulation. I may be able to use this probability in my report. Damien

POSTED BY: Damien Gregory

Be careful that my simulation is made with some assumptions that may or may not acceptable in your situation. For example, I assumed that abc matches abx and xbc and xab, but not axc, and not bac. Otherwise the code must be modified. Also, you must provide your own 45 combinations and start the simulation with them.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract