1
$\begingroup$

Initially i have N cards with value(1,2,..N) , each time i will destroy cards based on number of card left.

If N is odd , will leave smallest value card and destroy the half of the remaining cards.

If N is even will destroy half of the card.

what is the probability that Xth card is not being destroyed till last round?

Note: Each card has equal probability of not being destroyed.

  • 0
    Do you mean to say that you choose half of the cards uniformly at random and then destroy the chosen cards, when you say "destroy the half of the ... cards"?2017-02-22
  • 0
    What have you tried? What are your thoughts on the problem so far? Have you tried solving it for small N?2017-02-22
  • 0
    yes, after some rounds finally two cards left(one of the card is chosen card), My question here is how to carry forward each time probability of card not being destroyed after each round.2017-02-22
  • 0
    When you have even cards at the beginning of a round, every card, which you still have until then, has probability of $1/2$ for survival, that round. When you have odd cards at the start of a round, the lowest card always survives and the rest do with probability of $1/2$ ... but what is the chance that a card has survived to be the lowest card of that round?2017-02-23
  • 0
    I have solved a bigger problem than that: Hello, Saravana Perumal from TCS Retail. ;-)2017-02-23

2 Answers 2

1

It very much depends on $N$ and not in a simple way.


So, lets take thirteen cards as an example. In four steps :

  • You keep 1 and destroy six, leaving seven cards.

  • You keep 1 and destroy three, leaving four cards.

  • You destroy two cards, leaving two.

  • You destroy one card.

The probability for retaining 1 is $1/4$, and that for retaining any other particular card is: $1/16$.


Take fourteen cards.

  • You destroy seven, leaving seven cards.
    • The lowest card left is: $k\in\{1,2,3,4,5,6,7,8\}$ with probability $\binom{14-k}{8-k}/\binom{14}{7}$
  • You keep the lowest(which?) and destroy three cards, leaving four cards.

  • You destroy two cards, leaving two cards.

  • You destroy one card.

So the probability of a card being retained is ...?

1

This is not a full solution, but it should set the stage for a computer algorithm.

Fix $N$, and say we know we have $K$ trials for $X$ to survive. What you want to keep track of are the numbers

$\mathbb{P}[X\text{ and }b\text{ cards }0}\frac{1}{2}\mathbb{P}[\text{Hypergeometric}(N_i,a,\frac{N_i}{2})=a-b]$. If we call these numbers $c_{b,a}^i$, and let $c^i_b=\mathbb{P}[X\text{ and }b\text{ cards }

With that in mind I would consider the following code. For fixed $N$, run the division, find $N_i$ for all $i\leq K$, find $C^i$ based on $N_i$, then iteratively solve $c^i=C^{a_i}c^{i-1}$ until you get to $i=K$. I think this is your best bet because I don't think getting a closed form solution is tractable.

Edit: Okay, I said not tractable, in simple cases like $N=2^n$ or $N=2^n+1$ for some $n$ you can show that the probability is $\frac{1}{N}$, or $\frac{1}{2}$ for 1 and $\frac{1}{2(N-1)}$ otherwise respectively. In cases like $N=2^m(2^n+1)$ you can show that the probability is $\frac{1}{2^m+1}$ for $X=1$, and with some work you might be able to get a closed form for other $X$'s in this case.