Re: Unique patterns



On 12 Sep., 07:25, Chip Eastham <hardm...@xxxxxxxxx> wrote:
On Sep 11, 6:18 pm, zacar...@xxxxxxxxx wrote:

1. Im sorry if i have posted in the wrong group.
2. English is not my native language and if i have trouble explaining
my self im sorry for that too.
3. This is NOT homework. I have gotten that message alot and its
simply enoying!

It has to do with cards. A deck of cards has 52 cards and a single
card can have 4 different suits and 13 different values.
I drawing two cards, obiously they cant be exactly simular. Also im
ignoring the order of the cards im drawing.
e.g.
52*51 / 2! = 1326 different hands

Okay, we need to map all possible pairs of cards
to a number between 0 and 1325.

A single card can be looked upon like this:
{Suit, Value}
fx.
NB! im using ranges starting from zero fx. 0-3 instead of 1-4.

{3,12} & {3,11}

The mapping from (Suit,Value) to a number between 0 and 51 is
Suit + Value*4 (assuming Suit is 0 to 3 & Value is 0 to 13).
this is actually very usefull. Simple as it may be i just could find
the solution.

This hand would equal Ace King or Queen King in the same suit,
dependent on Ace being assigned lowest or highest value, but it doesnt
matter here.

The goal is to somehow calculate this specific hands unique patter in
the range of 0-1325.

[snip]

We have two distinct numbers, by the mapping above, between
0 and 51. Obviously one is bigger than the other, say m > n.

If n < 25, let m + n*52 represent the pair.

If n >= 25, let (51-m) + (50-n)*52 represent the pair.

generel i dont like conditional statements in a formula, but as it is
to be used in a computer program anyway, it doesnt matter much.
It should be clear that the smallest value represented
here is 0 (from m = 51, n = 50). The largest value is
for n = 25 so that the coefficient of 52 is maximized,
and m = 26:

(51-26) + (50-25)*52 = 25 + 25*52 = 1325

The range of representations is 0 to 1325, as desired.

Such a formulation can be extended, albeit awkwardly,
to higher dimensions/larger card hands.

This may be usefull as it is somewhat simpler than what matt
suggested, but i need to think it over.
regards, chip

thanks

.



Relevant Pages

  • Re: How to find mapping of NIC card and eth# ?
    ... >i want to know the mapping of NIC cards with eth#. ... >In my system Iam having two NICs from same manufacturer ... >Then how to resolve this mapping. ... If the cards are identical, then the only way to tell them apart is ...
    (linux.redhat)
  • Re: Unique patterns
    ... It has to do with cards. ... The mapping from to a number between 0 and 51 is ... The goal is to somehow calculate this specific hands unique patter in ... The range of representations is 0 to 1325, ...
    (sci.math)
  • Re: Epistemology 201: The Science of Science
    ... > But the rule/equation based on is NOT. ... But that's what mapping is. ... describing/stating mapping functions somewhat more concisely and clearly. ... cards on the chairs to see if you've any name cards left over. ...
    (sci.cognitive)
  • Re: Epistemology 201: The Science of Science
    ... > But the rule/equation based on is NOT. ... But that's what mapping is. ... describing/stating mapping functions somewhat more concisely and clearly. ... cards on the chairs to see if you've any name cards left over. ...
    (sci.physics)
  • Re: Epistemology 201: The Science of Science
    ... > But the rule/equation based on is NOT. ... But that's what mapping is. ... describing/stating mapping functions somewhat more concisely and clearly. ... cards on the chairs to see if you've any name cards left over. ...
    (sci.math)