Previous in Forum: Autodesk Inventor Question   Next in Forum: Fatal Error? Autocad
Close
Close
Close
13 comments
Rate Comments: Nested
Associate
United Kingdom - Member - New Member Fans of Old Computers - ZX-81 - Dragon 32

Join Date: Feb 2007
Posts: 36

Pemutations of Sudoku method anyone?

04/04/2007 4:29 AM

Hi,

Given that the digits 1 through to 9 can be re-arranged 362,880 different ways ( permutations ) or 9P9 how could you mutually exclude all the sub-sets of these where the 1st 3 digits are the same ( but in any order ), the 4th to 6th digits are the same ( but in any order ) such that the last three digits are different anyway by default.

What i am basically after doing ( programatically ) is checking the possible total solutions for Sudoku so the 1st line could be>>

123456789

but the 2nd line can't have 1, 2 or 3 in the 1st 3 characters,

can't also have 4, 5 or 6 in characters 4 to 6 and for the last 3 can't have

7, 8 or 9

Repeat as per Sudoku rules down to the last or 9th line.

As a side tought i've wondered if nought could be used in a 9 by 9 grid, how many solutions there now are?

I've thought of bit-wise masking so i'm posting this in the programmers forum too.

In case you are curious 10P9 yields 3,628,880 ( ten times as many variations for the 1st line alone ).

I would be curious how to do this for any size of grid using say

0 to 9, A to Z and a to z as characters.

Regards,

Dr M.

Register to Reply
Pathfinder Tags: Permutation permutations sudoku
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Guru

Join Date: Nov 2006
Location: KnoxTN
Posts: 1485
Good Answers: 6
#1

Re: Pemutations of Sudoku method anyone?

04/04/2007 11:41 PM

IIRC the Sudoku site covered some, if not most, of this some time back. Mainly setting up all possible puzzles to foist off on an unsuspecting puzzle fanatics.

You can have your fun your way. I have my own ideas of fun.

Thank you just the same.

__________________
Do Nothing Simply When a Way Can be Found to Make it Complex and Wonderful
Register to Reply
Guru

Join Date: Dec 2005
Location: Etats Unis
Posts: 1871
Good Answers: 45
#2

Re: Pemutations of Sudoku method anyone?

04/05/2007 1:26 AM

Sorry I just can't get into games with such a small set of possibilities. I prefer GO with something like 10^200 possible permutations. Beats the heck out of Sudoku and even Chess.

__________________
The hardest thing to overcome, is not knowing that you don't know.
Register to Reply
Anonymous Poster
#3
In reply to #2

Re: Pemutations of Sudoku method anyone?

04/05/2007 10:24 AM

What is it with some of you guys? Why do you feel the need to to thrust yourselves up to a position of supposed superiority over fellow posters? Dr. Marten has laudably chosen to engage himself in a thoughtful analysis excercise. So what if someone's done it already, or it's not your idea of fun. Give the guy a break, or better yet, a hand. This is not place for mental flexing and posturing. Let's keep this a positive and constructive forum and leave your personal biases out of it.

Register to Reply
Anonymous Poster
#4
In reply to #3

Re: Pemutations of Sudoku method anyone?

04/05/2007 10:30 AM

Ooh! He told you! And you! And You, too!

Register to Reply
Guru

Join Date: Nov 2006
Location: KnoxTN
Posts: 1485
Good Answers: 6
#5
In reply to #3

Re: Pemutations of Sudoku method anyone?

04/05/2007 10:56 AM

"What is it with some of you guys? --- Let's keep this a positive and constructive forum and leave your personal biases out of it."

And YOU TWO are hiding under your desks aka 'Guests' name!

__________________
Do Nothing Simply When a Way Can be Found to Make it Complex and Wonderful
Register to Reply
Guru

Join Date: Dec 2005
Location: Etats Unis
Posts: 1871
Good Answers: 45
#6
In reply to #3

Re: Pemutations of Sudoku method anyone?

04/05/2007 2:43 PM

I don't think the good Doctor has been hurt by my polite comment expressing a preference. The comment was relevent in that it pointed out another game with a large number of permutations, if you even understand what that means. I did not pass judgement on his behavior as you now do on mine. If you really want to know what I think it is that generally speaking and more and more so GUESTS SUCK. Whether too lazy to sign up or too weak to not need to hide behind the anonymity of guest status or maybe even members who log on as guests I wish there were not such an option to do so. People like you abuse the status when you come in with your critical pot shots and from the safety of no identity you can be rude, as many of you are. You can kiss my rear as far as I'm concered.

__________________
The hardest thing to overcome, is not knowing that you don't know.
Register to Reply
Guru
United Kingdom - Member - Olde Member!! Engineering Fields - Instrumentation Engineering - New Member

Join Date: Jul 2006
Location: Dunstable, England
Posts: 2821
Good Answers: 45
#7

Re: Pemutations of Sudoku method anyone?

04/08/2007 8:17 AM

I'm working on the next level of sudoku.

It uses hexadecimal 0 to F with a 4 by 4 layout...

Even I am having trouble doing it and I'm a sudoku maniac!!

John

__________________
A little knowledge is a dangerous thing - Googling is far worse!
Register to Reply
Guru
Popular Science - Weaponology - New Member

Join Date: Feb 2006
Posts: 962
#8
In reply to #7

Re: Pemutations of Sudoku method anyone?

04/09/2007 8:55 AM

Elektor magazine by any chance. Yes it's me again.

__________________
There's them that knows and them that just thinks they know, whitch are you? Stir the pot and see what rises up. I have catalytic properties I get a reaction going.
Register to Reply
Guru
United Kingdom - Member - Olde Member!! Engineering Fields - Instrumentation Engineering - New Member

Join Date: Jul 2006
Location: Dunstable, England
Posts: 2821
Good Answers: 45
#9
In reply to #8

Re: Pemutations of Sudoku method anyone?

04/09/2007 10:59 AM

Is Elektor magazine still going Brainwave??

The last issue I saw must have been in the 70s

John.

__________________
A little knowledge is a dangerous thing - Googling is far worse!
Register to Reply
Guru
Popular Science - Weaponology - New Member

Join Date: Feb 2006
Posts: 962
#13
In reply to #9

Re: Pemutations of Sudoku method anyone?

04/10/2007 5:47 PM

Very much so they run a competition using Hex for their Sudoku. It is now Elektor Electronics also available on the web.

__________________
There's them that knows and them that just thinks they know, whitch are you? Stir the pot and see what rises up. I have catalytic properties I get a reaction going.
Register to Reply
Associate
United Kingdom - Member - New Member Fans of Old Computers - ZX-81 - Dragon 32

Join Date: Feb 2007
Posts: 36
#10

Re: Pemutations of Sudoku method anyone?

04/09/2007 5:28 PM

Hi All,

Me again ( wiv me BIG boots on ).

Anyway, i am rarely hurt at all by comments in post threads, just to let you all know.

What if you had a 36 x 36 grid using the characters 0 to 9 and the letters A..Z and a..z? With 36 sub-grids of 6 X 6 character spaces. How many permutations then?

I am after the "thought" process you might use to come up with the total number or permutations really, for ANY size of Sudoku grid, as a PROGRAMMING exercise, no it's not homework!!

It is all down to curiosity really!!

I have created a small VB.Net program that iterates from 12456789 to 987654321 and spits out all the numbers where each digit is different.

It takes ages though, just to do that!! :-(

I'm off to try the same question on two programmers forums....

Regards,

Dr M.

(Stomping off in BIG 'bovver' boots....)

Register to Reply
Associate
United Kingdom - Member - New Member Fans of Old Computers - ZX-81 - Dragon 32

Join Date: Feb 2007
Posts: 36
#11

Re: Pemutations of Sudoku method anyone?

04/09/2007 5:44 PM

Hi ALL,

'Here is the code anyway ( that i mention in my previous post ).>>

Dim num(9) As Integer

Dim numString(9) As String

'Dim possNums(9000000) As Integer

Dim possString As String

'Dim sw As New StreamWriter("C:\myNumbers.txt")

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim count, index As Integer

For index = 123456789 To 987654321

If (uniNum(index) = True) Then

count += 1

'possNums(count) = index

TextBox1.AppendText(count.ToString & " " & index.ToString & vbCrLf)

'sw.WriteLine(count.ToString & " " & index.ToString & vbCrLf)

End If

If count Mod 50 = 0 Then TextBox1.Clear()

Next

'sw.Close()

MsgBox(count.ToString)

End Sub

'Test to see if number is like 123456789 or 987654321

'where each digit is different.

Private Function uniNum(ByVal num As Integer) As Boolean

Dim numS(9) As String

Dim str1 As String

Dim index1, index2, index3 As Integer

str1 = num.ToString

For index1 = 0 To 8

numS(index1) = str1.Substring(index1, 1)

Next

For index2 = 0 To 9

For index3 = 0 To 9

If index2 = index3 Then GoTo SkipTest

'See if the number 'num' contains a "0"

If numS(index2) = "0" Then Return False

'Compare each number in the number 'num' with itself.

If numS(index2) = numS(index3) Then Return False

SkipTest:

Next

Next

If index2 = 10 And index3 = 10 Then Return True

End Function

Register to Reply
Guru
Engineering Fields - Manufacturing Engineering - United Kingdom - Member - Get things done!

Join Date: Jul 2006
Location: East Anglia, UK
Posts: 2003
Good Answers: 3
#12
In reply to #11

Re: Pemutations of Sudoku method anyone?

04/10/2007 2:52 AM

Whooo! I'll stick to the crosswords, thanks.

__________________
'The truth is out there' The lies are in your head.
Register to Reply
Register to Reply 13 comments
Copy to Clipboard

Users who posted comments:

Anonymous Poster (2); BrainWave (2); DrMarten (2); Electroman (2); PlbMak (1); rcapper (2); Stirling Stan (2)

Previous in Forum: Autodesk Inventor Question   Next in Forum: Fatal Error? Autocad
You might be interested in: Line-shaft Spools, Power Line Network Components

Advertisement