OZONE Asylum
Forums
Server-Side Scripting - Oh my!
Latin Squares and XOR
This page's ID:
33315
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
T + XOR = F! Transversals, yo. [code] 0 1 2 3 0 . . . . 1 . . . . 2 . . . . 3 1 0 3 2 --> . . 3 . . . . 2 1 . . . . 0 . . ---+ 2 3 0 1 . . . 1 . . 0 . . 3 . . 2 . . . | 3 2 1 0 . 2 . . 3 . . . . . . 0 . . 1 . | | 0 1 2 3 0 . . . . 1 . . . . 2 . . . . 3 | 2 3 0 1 <-- . . 0 . . . . 1 2 . . . . 3 . . <--+ 3 2 1 0 . . . 0 . . 1 . . 2 . . 3 . . . 1 0 3 2 . 0 . . 1 . . . . . . 2 . . 3 . [/code] Find a bunch of transversals. Play a rousing game of cover-all. Flatten each trans to a single symbol. Put it back together. Boom. Orthogonal mate. Try to find a transversal in this: [code] 0 1 2 3 1 0 3 2 2 3 1 0 3 2 0 1 [/code] Let's try some brute force on that little guy: [code] #!/usr/bin/env python # -*- coding: utf-8 -*- import itertools def cout_trans(cgrid,inds): ll=len(cgrid) bseq=['0','1','2','3','4','5','6','7', '8','9','A','B','C','D','E','F'] for trow in range(ll): cme=' ' for tcol in range(ll): if inds[trow]==tcol: cme=cme+' '+bseq[cgrid[trow][tcol]] else: cme=cme+' .' print(cme) print('') return tgrid=[[0,1,2,3], [1,0,3,2], [2,3,1,0], [3,2,0,1]] dr=len(tgrid) tcount=0 for p in itertools.permutations(range(dr)): tset=set() for c in range(dr): tset.add( tgrid[c][p[c]] ) if len(tset)==dr: tcount=tcount+1 cout_trans(tgrid,p) print('tcount={}').format(tcount) [/code] Toss other tgrids in there and see what it spits out to screen. When it comes to transversals and XOR, orthogonal mates pop out all over the place. In most cases, brute force the whole solution. Not the case with XOR. With XOR, one transversal holds enough information for a complete orthogonal mate solution. With XOR, just one trans is all you need. Here is a transversal using XOR=8 and the associated data: [code] . . . . . 5 . . . . . . . . 7 . . . 0 . . . . . . 2 . . . . . . . . . . . . . 3 . . . . 1 . . . 6 . . . . . . . . . . 4 . . . . row=[0,1,2,3,4,5,6,7] col=[5,6,2,1,7,4,0,3] val=[5,7,0,2,3,1,6,4] [/code] Try swapping that data around to make a permutation. Something like: [code] nrow=col ncol=val nval=row [/code] You might be surprised (or not surprised) as to what gets spit out. One day I was playing with re-indexing transversal data to the diagonal in the XOR grid. And I got some variables mixed around. But I didn't think anything about it at the time because I was still getting a valid orthogonal mate. That was a real mind-bender. Once I realized, I started mixing things up intentionally. More mind-bending. Once you have a single transversal in an XOR grid, getting a full orthogonal is wicked easy. But how easy, or not easy, is it to get a transversal in the first place? Well, when you are dealing with an XOR grid base, not that hard at all. Depending on a few things. Like your sense of humour.
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »
Maximum Security
OZONE
DHTML/Javascript
Server-Side Scripting - Oh my!
CSS - DOM - XHTML - XML - XSL - XSLT
Stupid Basic HTML
Visual Therapy
Photoshop
Photoshop Pong, Anyone?
***WARNING*** BIG SIG APPROACHING
Photography
3D Modelling & Rendering
Multimedia/Animation
Print Graphics
Holding Pens
Philosophy and other Silliness
Outpatient Counseling
Site reviews!
Mad Scientists' Laboratory
Getting to know the Grail