Does this algorithm guarantee equaprobable outcomes?

  • Context: Undergrad 
  • Thread starter Thread starter Bipolarity
  • Start date Start date
  • Tags Tags
    Algorithm
Click For Summary

Discussion Overview

The discussion revolves around an algorithm for selecting a number from a list using a coin-flipping method. Participants explore whether this method guarantees that all numbers in the list are equally likely to be the final stored number and consider potential modifications to achieve equaprobable outcomes.

Discussion Character

  • Exploratory
  • Debate/contested
  • Technical explanation

Main Points Raised

  • One participant describes an algorithm involving a list of numbers and coin flips to determine the final stored number.
  • Another participant asserts that the numbers are not equiprobable, noting that the last number has a 50% probability of being selected.
  • A participant questions whether each number has half the probability of its successor and seeks ways to modify the algorithm for equaprobability.
  • Another participant suggests generating a random number to select an index directly, which could ensure equaprobability.
  • A participant raises a question about the equiprobability of coin flips themselves.

Areas of Agreement / Disagreement

Participants express disagreement regarding the equiprobability of outcomes from the algorithm, with some asserting it does not guarantee equal likelihood while others explore potential modifications to achieve this.

Contextual Notes

There are unresolved assumptions regarding the behavior of the coin flips and the implications of the algorithm's structure on the probabilities of selection.

Bipolarity
Messages
773
Reaction score
2
Suppose you have a list of numbers, say ##{1, 7, 9, 4, 5, 6}##.
You store the first number, and then iterate through this list.
For each number in the list, you flip a coin. If it is heads, you swap that element in the list with the number you stored. If tails, you do nothing. Either way, you move on to the next number in the list.

When you finish traversing the list, the resulting number is the number you stored. I am curious if all numbers in the list are equaprobably to be the final stored number, and if this is indeed the case, how might one prove this?

Thanks!

BiP
 
Physics news on Phys.org
No, the numbers are not equiprobable. The last number has a 50 % probability.
 
Ah I see, I suppose then that each number has half the probability of its successor?

Also, do you think there might be a way for me to tweak this so that the numbers are indeed equaprobable? This is for an application I'm trying to build.

BiP
 
Last edited:
Bipolarity said:
Ah I see, I suppose then that each number has half the probability of its successor?

Yes, apart from the first number which has the same.

Bipolarity said:
Also, do you think there might be a way for me to tweak this so that the numbers are indeed equaprobable? This is for an application I'm trying to build.
Yes, but the normal thing to do would be to simply generate a random number k between 1 and N, where N is the number of numbers you have and then select the kth number.
 
Coin flips aren't equiprobable , are they ?

ETA: never mind, I see the thread already :P
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 45 ·
2
Replies
45
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 17 ·
Replies
17
Views
4K
Replies
2
Views
1K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K