Unique patterns
- Kevin McGuire
- Member
- Posts: 843
- Joined: Tue Nov 09, 2004 12:00 am
- Location: United States
- Contact:
Just one last question, then i wont bother you anymore
The stuff suggested so far, focuses, if im not mistaken, on generating an unique pattern from which the original values can be (cant seem to find the right word) calculated.
e.g. values -> pattern -> values
but what if what if i only need the unique pattern and not the ability to do the stuff backwards?
fx. still focusing on cards.
2 cards give 1326 unique combinations, not focising on the order. 52*51 / 2! = 1326
0 - 1325 should be the values the patters could contain.
of course sorting them would still be the easy aproach, but it would give a pattern of a different type, a pattern where the cards involved can be recognised. this is not wanted in this scenario. The reasons are hard to explain, maybe ill try later.
e.g.
50, 51 = unique x
51, 50 = same as above
50, 51 = same as above
50, 49 = new unique x
etc.
and all these paterns is unique and in the range 0 - 1325
basicly:
S=suit, V=value
S{s1, s2} == 0 - 15 (s1==s2)?(v1!=v2):(s1!=s2)
V{v1, v2} == 0 - 168 (v1==v2)?(s1!=s2):(v1!=v2)
this however does not exclude the order from the pattern, which is most important.
edit:
i just read this through a couple of times and realise that i my self would probably have a hard time understanding it, and the purpose, but i dont think i can do any better.
ask questions if needed and ill try to answer, or refrain from answering.
Thanks
The stuff suggested so far, focuses, if im not mistaken, on generating an unique pattern from which the original values can be (cant seem to find the right word) calculated.
e.g. values -> pattern -> values
but what if what if i only need the unique pattern and not the ability to do the stuff backwards?
fx. still focusing on cards.
2 cards give 1326 unique combinations, not focising on the order. 52*51 / 2! = 1326
0 - 1325 should be the values the patters could contain.
of course sorting them would still be the easy aproach, but it would give a pattern of a different type, a pattern where the cards involved can be recognised. this is not wanted in this scenario. The reasons are hard to explain, maybe ill try later.
e.g.
50, 51 = unique x
51, 50 = same as above
50, 51 = same as above
50, 49 = new unique x
etc.
and all these paterns is unique and in the range 0 - 1325
basicly:
S=suit, V=value
S{s1, s2} == 0 - 15 (s1==s2)?(v1!=v2):(s1!=s2)
V{v1, v2} == 0 - 168 (v1==v2)?(s1!=s2):(v1!=v2)
this however does not exclude the order from the pattern, which is most important.
edit:
i just read this through a couple of times and realise that i my self would probably have a hard time understanding it, and the purpose, but i dont think i can do any better.
ask questions if needed and ill try to answer, or refrain from answering.
Thanks
If there's a one to one relationship between set of cards and ids, then you will always be able to go backwards (though it may be extremely difficult depending on the function). There wasn't really a focus on that. The focus was on functions that don't care about the order of their arguments.
As for whether there's a nice equation that packs all the ids into the smallest range possible, that would require more maths . Maybe it's as simple as performing some modulos somewhere.
[edit]
I randomly tried some things, and found that taking i, j and k modulo 53 seems to work (not 100% certain though). That'd let you fit everything into 18 bits. It's the smallest prime above 52. I have absolutely no clue if that's just a coincidence.
As for whether there's a nice equation that packs all the ids into the smallest range possible, that would require more maths . Maybe it's as simple as performing some modulos somewhere.
[edit]
I randomly tried some things, and found that taking i, j and k modulo 53 seems to work (not 100% certain though). That'd let you fit everything into 18 bits. It's the smallest prime above 52. I have absolutely no clue if that's just a coincidence.
posted my problem at http://groups.google.com/group/sci.math ... 8c6eeb6adb
Actually got a solution allthough aomewhat complicated.
Actually got a solution allthough aomewhat complicated.