Probability of Same Relative Order of n Elements

  • Context: Undergrad 
  • Thread starter Thread starter dabd
  • Start date Start date
  • Tags Tags
    Probability
Click For Summary

Discussion Overview

The discussion revolves around calculating the probability that two sequences of size n maintain the same relative order. Participants explore the implications of this question in the context of permutations and sorting, considering both distinct and non-distinct elements.

Discussion Character

  • Exploratory
  • Mathematical reasoning
  • Conceptual clarification

Main Points Raised

  • One participant introduces the problem of determining the probability that two sequences are in the same relative order, providing an example with specific sequences.
  • Another participant suggests that the first sequence can be any arrangement, prompting a consideration of how many valid arrangements exist for the second sequence.
  • A further reply emphasizes that there are infinitely many possibilities for the second sequence and explains that two sequences are in the same relative order if their sorted positions match.
  • One participant notes that the problem becomes simpler if the elements are assumed to be distinct.
  • Another participant estimates that for an array of n numbers, there are n! possible permutations, suggesting that the probability for the example given would be 1/(5!).

Areas of Agreement / Disagreement

Participants express varying views on how to approach the problem, particularly regarding the treatment of distinct versus non-distinct elements. The discussion remains unresolved, with no consensus on the exact probability calculation.

Contextual Notes

Participants have not fully resolved the assumptions regarding the nature of the elements in the sequences (distinct vs. non-distinct) and how this affects the probability calculation. There are also unresolved mathematical steps in determining the 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!).
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 35 ·
2
Replies
35
Views
5K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 28 ·
Replies
28
Views
6K
  • · Replies 9 ·
Replies
9
Views
2K