Probability of Same Relative Order of n Elements

  • Thread starter Thread starter dabd
  • Start date Start date
  • Tags Tags
    Probability
dabd
Messages
25
Reaction score
0
Hi,

Given two arrays (or sequences) of size n. What is the probability that they are in the same relative order?

Ex: s = [5, 10, 18, 3, 7] and t = [6, 9, 20, 1, 7] are in the same relative order.

Note: The elements of the sequence are drawn from a set with a total order defined, say the natural numbers.

Thanks.
 
Last edited:
Physics news on Phys.org
Hi dabd! :smile:

Hint: the first sequence can be anything, in any order.

So how many possiblities are there for the second sequence? :wink:
 
tiny-tim said:
Hi dabd! :smile:

Hint: the first sequence can be anything, in any order.

So how many possiblities are there for the second sequence? :wink:

Of course there infinitely many possibilities for the second sequence.

Putting it in other way, two sequences of length n are in the same relative order if we sort them and their elements positions (in the original sequences) are the same.

s = [5, 10, 18, 3, 7] positions = [1, 2, 3, 4, 5]

and t = [6, 9, 20, 1, 7] positions = [1, 2, 3, 4, 5]


s'= [3, 5, 7, 10, 18] positions = [4, 1, 5, 2, 3]
and t' = [1, 6, 7, 9, 20] positions = [4, 1, 5, 2, 3]

Given the first sequence just sort it and note the positions (4, 1, 5, 2, 3) in the example.
For the second sequence any sorted sequence will do, and of course there are infinitely many different sorted sequences, and to get the same relative order sequence just "unshuffle" its positions.

But, I don't get how can I compute the probability!
 
The problem simplifies dramatically if the elements are assumed to be distinct.
 
I think that for an array of n numbers, there are n! possible permutations... so I guess that for your example the prob would be 1/(5!).
 
Namaste & G'day Postulate: A strongly-knit team wins on average over a less knit one Fundamentals: - Two teams face off with 4 players each - A polo team consists of players that each have assigned to them a measure of their ability (called a "Handicap" - 10 is highest, -2 lowest) I attempted to measure close-knitness of a team in terms of standard deviation (SD) of handicaps of the players. Failure: It turns out that, more often than, a team with a higher SD wins. In my language, that...
Hi all, I've been a roulette player for more than 10 years (although I took time off here and there) and it's only now that I'm trying to understand the physics of the game. Basically my strategy in roulette is to divide the wheel roughly into two halves (let's call them A and B). My theory is that in roulette there will invariably be variance. In other words, if A comes up 5 times in a row, B will be due to come up soon. However I have been proven wrong many times, and I have seen some...
Back
Top