Live data from Hacker News

52 Factorial

czep.net

41–50 of 65 posts

Re: 52 Factorial

#41
post #11

You can use one deck to encode 225 bits of information.

277 if we encode information in whether each card is face up or down

Some cards are not symmetrical, (e.g. any seven or a five of not-diamonds) so they can encode two bits of information.

Re: 52 Factorial

#42

Earlier quoted context omitted.

277 if we encode information in whether each card is face up or down

Not quite, because you won't be able to tell the deck orientation any more.

So, then 275? With the both the top and bottom card face down?

That's going in my next spy novel. Spy 1 gets together with Spy 2, for cracking game of Cribbage, and at the end, Spy 2 walks out with a deck of cards, but it's actually a 256 bit encryption key.

Re: 52 Factorial

#43

Is it safe to say that it's almost certain that no two people have ever shuffled a deck of cards in the exact same order?

That would only be safe if you assumed everyone shuffled well.

The likelihood that more than one person used a poor or lazy shuffling technique on a brand new deck of cards seems significant.

Re: 52 Factorial

#44
post #3
post #2

So if I want a collection of card decks in every possible combination I should start collecting now, got it.

With this, you could invent a very unique magic trick where your spectator well-shuffles a deck of cards, then you can secretly swap your deck with one of the decks from your collection to reveal that yours was shuffled in the exact same way.

This is a relatively well known technique in card manipulations known as a "cold deck". There are many variations of it involving probabilistic but not entirely deterministic forces that lead to a branching path to a different cold deck.

Re: 52 Factorial

#45

> This number is beyond astronomically large. 52! ~ 10^67 is far many orders of magnitude than the number of particles in the universe, which is exactly an astronomical number.

A word got lost, but current estimates for Universe particles are around 10^80, so 52! is 13 magnitudes smaller.

Re: 52 Factorial

#46
post #26

I would guess the author is a fan of Joyce: > What must it be, then, to bear the manifold tortures of hell forever? Forever! For all eternity! Not for a year or an age but forever. Try to imagine the awful meaning of this. You have often seen the sand on the seashore. How fine are its tiny grains! And how many of those tiny grains go to make up the small handful which a child grasps in its play. Now imagine a mountai…

And maybe Joyce was a fan of the Brothers Grimm! [1]

  "The third question is, how many seconds of time are there in
  eternity?" Then said the shepherd boy: "In Lower Pomerania is the Diamond
  Mountain, which is two miles and a half high, two miles and a half wide,
  and two miles and a half in depth; every hundred years a little bird
  comes and sharpens its beak on it, and when the whole mountain is worn
  away by this, then the first second of eternity will be over."
[1] https://www.grimmstories.com/en/grimm_fairy-tales/the_shephe...

Re: 52 Factorial

#47

In terms of actually playing games with cards, the effective number of permutations can be much smaller (though still large enough to be going on with). In many card games, the suits are distinct but functionally identical; you could swap spades rank-for-rank with hearts and get a functionally equivalent deck. In Klondike solitaire, the tableau is concerned with red cards and black cards, not all four suits. I imagin…

Pretty easy to calculate how many distinct shuffles considering only the numbers: 52!/(4!^13)=~9.2e49. Still monstrously big

Re: 52 Factorial

#48

The number has 12 zeroes at the end, which confused me for a bit, so I'm leaving this comment in case anyone else is similarly confused and would like to know why. There are 10 total numbers between 1 and 52 which include 5 as a factor (5 which also include 2 as a factor to make a factor of 10 and 5 more to be multiplied with a bunch of other 2-factor numbers) so intuitively I was thinking there should be 10 zeroes.…

The cute general theorem is: if p is a prime number then the number of times p divides n factorial is floor(n/p) + floor(n/p^2) + floor(n/p^3) + ...

And from this (or by other arguably more elegant means) one can get the related cute theorem: the number of times p divides the binomial coefficient (n choose r) is the number of carries that occur when adding r to n-r in base p.

In particular, if n = p^k then unless r=0 or r=n there is always at least one carry because n is "longer" than r and n-r, so all the binomial coefficients (p^k choose r) are multiples of p apart from (p^k choose 0) and (p^k choose p^k).

(You can use this sort of idea to understand why, if you write out many many rows of Pascal's triangle mod 2, you get a sort of Sierpinski gasket thing.)

Re: 52 Factorial

#50
post #35
post #20

Earlier quoted context omitted.

ln(52!)/ln(2)≈226 bits. You don't have to depend on a single random 64-bit number: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle

If the RNG has < 226 bits of state, such as most non cryptographic PRNGs, you cannot reach all shuffles even if you use multiple numbers.

I'm not totally sure that's true. I get where you are coming from, an 8 bit rng can only output 256 distinct values at most. 256 would be the longest cycle.

However if you combine the outputs of two, but don't step them at the same time, you can have more outputs.

Imagine you had one that outputs just 0 and 1 and then loops. You could have two of these updating at a different frequency and have four distinct outputs.

I think that makes sense.

Post reply on HN