top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Whose algorithm is better, or does it really matter?

+1 vote
178 views

Alice and Bob want to make a card shuffling machine for their poker club. The problem is that they propose different algorithms and thus can't decide which one to apply:

Alice: For each card (going from left to right), swap it with one of the cards on its right, including itself.
Bob: For each card (going from left to right), swap it with any other card.

Whose algorithm is better, or does it really matter?

posted Feb 13, 2017 by anonymous

Share this puzzle
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Alice's algorithm will bring the set of cards to the initial state after shuffling which defeats it's purpose.
And depending upon how Bob's algorithm randomly choses the 2nd card to swap positions with, its clearly better than Alice's algorithm. After all even if the final state is equal to the initial state in Bob's algorithm (which is very very unlikely) it's still one of the many random possible state.

answer Feb 26, 2017 by Tejas Naik



Similar Puzzles
+1 vote
  1. (1/10) statement is false
  2. (2/10) statement is false
  3. (3/10) statement is false
  4. (4/10) statement is false
  5. (5/10) statement is false
  6. (6/10) statement is false
  7. (7/10) statement is false
  8. (8/10) statement is false
  9. (9/10) statement is false
  10. (10/10) statement is false.
0 votes

I met four of my old school friends today. In the morning I first saw Patricia and later bumped into Richie. Then in the afternoon I saw Christabel. Who did I encounter in the evening? Was it Thora, Stella, Thelma or Sally?

+2 votes

Statement: I am lying and I always lies.

Tell me whether I am lying or telling the truth?

0 votes

I have a friend whose name is Jack. He is really lazy. His science homework is to bring in one pound of something. He said that he's too lazy to find something that weighs a pound and something to hold it. He asked me to get those two things for him. I have 3 options: a thick wooden box that is holding a pound of bricks, a one-pounder shoulder bag, and a stack of a pound of books wrapped in one layer of thin wrapping paper. I want to give Jack the heaviest of my three objects. Which one should I choose?

...