Page 2 of 3

Re: Problem 090

Posted: Wed Jul 04, 2012 9:06 pm
by JiminP
I can't find what I did wrong, even after looking at my code and thinking for months. My way of solving this was to check all possible 210*210 states and eliminating duplicating set (counted same set (dice swapped) twice) by simple method by knowing a simple fact. But the result 45xx was wrong.

Is there anything wrong below?
  • If there were no constrain about displaying square numbers, and two dice were different, 10C6 * 10C6 = 210 * 210 = 44100 were the answer.
  • A dice has six sides, digit 0~9 are written on them. On a dice, no duplicating digits are permitted.
  • Six is different from nine. They are considered same only when a square number is formed.
  • {1,2,3,4,5,6} + {0,1,2,3,7,8} is a valid set.
  • above set and {1,2,3,4,5,9} + {0,1,2,3,7,8} is different, and it is a valid set either.
  • {0,1,2,3,7,8} + {1,2,3,4,5,9} and above set are same, and is different from the first set.
  • 'arrangement' only cares about kind of digits. Ways of writing digits on sides doesn't matter at all.
  • Two dice can be swapped (when forming different square numbers).

Re: Problem 090

Posted: Wed Jul 04, 2012 10:15 pm
by TripleM
{1,2,3,4,5,6} + {0,1,2,3,7,8} is a valid set.
How do you form 49 with these dice?

Re: Problem 090

Posted: Thu Jul 05, 2012 12:44 pm
by JiminP
TripleM wrote:
{1,2,3,4,5,6} + {0,1,2,3,7,8} is a valid set.
How do you form 49 with these dice?
Aha! Thank you so much! Now I see the problem... :D

Re: Problem 090

Posted: Tue Oct 16, 2012 8:36 pm
by PrimeRing
I think it would be nice to insert a "but" beteween these two lines:

{1, 2, 3, 4, 5, 6} is equivalent to {3, 6, 4, 1, 2, 5}
but [inserted by request - euler]
{1, 2, 3, 4, 5, 6} is distinct from {1, 2, 3, 4, 5, 9}

On my first (hasty) reading, I thought they were both "is equivalent to" statements.

However, I forgot that majority of these problems rely on these random, artificial restrictions to transform an ultra-tedious question into a super-boring-hey-your-shoes-are-untied question.

I understand if you leave it in though: if you didn't have these sorts of pitfalls everybody would solve these types of problems rather quickly...

Re: Problem 090

Posted: Tue Oct 16, 2012 8:54 pm
by hk
You're not obliged to solve PE problems if you don't like them. You can restrict yourself to those you like, if that leaves you any to be solved.

Re: Problem 090

Posted: Wed Oct 17, 2012 7:26 am
by euler
PrimeRing wrote:I think it would be nice to insert a "but" beteween these two lines:

{1, 2, 3, 4, 5, 6} is equivalent to {3, 6, 4, 1, 2, 5}
but [inserted by request - euler]
{1, 2, 3, 4, 5, 6} is distinct from {1, 2, 3, 4, 5, 9}

On my first (hasty) reading, I thought they were both "is equivalent to" statements.

However, I forgot that majority of these problems rely on these random, artificial restrictions to transform an ultra-tedious question into a super-boring-hey-your-shoes-are-untied question.

I understand if you leave it in though: if you didn't have these sorts of pitfalls everybody would solve these types of problems rather quickly...
Many of these problems are subtle in nature - that is often the challenge. Those two statements, however, are not an example of subtlety. If someone was able to miss the plain and clear difference between the two phrases "is equivalent to" and "is distinct from" then what makes you think they would spot the word "but"?

Problem 090

Posted: Sat Jan 12, 2013 8:11 pm
by matmsh
Does
{ {0,1,2,3,4,5}, {0,1,2,6,7,8} },
{ {0,1,2,3,4,5}, {0,1,2,9,7,8} }

counts as one arrangement { {0,1,2,3,4,5}, {0,1,2,6,7,8,9} }
or two distinct arrangements ?

Thanks in advance for any assistance !
Shing

Re: Problem 90 Cube digit pairs

Posted: Sat Jan 12, 2013 8:22 pm
by matmsh
Sorry ! I just found out there is already a thread on this under "Problem 090".

Re: Problem 090

Posted: Sat Jan 12, 2013 8:33 pm
by hk
Fixed

Re: Problem 090

Posted: Wed Jan 16, 2013 12:23 pm
by wh97341375
COme on. buddy. all of you are excellent.

Re: Problem 090

Posted: Thu Jul 18, 2013 7:29 pm
by Yamaneko
Can someone please clarify the problem to me some more?
The definition says this:
However, for this problem we shall allow the 6 or 9 to be turned upside-down
but, wouldn't that mean that
{1, 2, 3, 4, 5, 6} is not distinct from {1, 2, 3, 4, 5, 9} ?

Or there is something there that I'm completely missing... :oops:

Re: Problem 090

Posted: Thu Jul 18, 2013 7:37 pm
by thundre
Yamaneko wrote:Or there is something there that I'm completely missing... :oops:
The next paragraph makes it more clear:
But because we are allowing 6 and 9 to be reversed, the two distinct sets in the last example both represent the extended set {1, 2, 3, 4, 5, 6, 9} for the purpose of forming 2-digit numbers.
In other words, if a set with 6 in it (and not 9) works, the same set with 9 substituted will also work. So count both.

Re: Problem 090

Posted: Fri Jul 19, 2013 1:51 pm
by Yamaneko
Ah, I get it now! Thanks, that cleared it up nicely! :D

Re: Problem 090

Posted: Mon Aug 24, 2015 5:31 am
by Neilius
Does this count as one arrangement or two:
(1) { 0, 1, 2, 6, 7, 9 } { 1, 3, 4, 5, 8, 9 }
(2) { 1, 3, 4, 5, 8, 9 } { 0, 1, 2, 6, 7, 9 }

I.e. if you swap the cubes around is that the same arrangement even though the combinations of digits now appear on the other cube?

Re: Problem 090

Posted: Mon Aug 24, 2015 5:54 am
by TripleM
Those are considered different, but your second solution can't display 01, for example, so that's only one solution.

If both of them resulted in being able to display all of the squares, then that would be two solutions.

Re: Problem 090

Posted: Mon Aug 24, 2015 5:59 am
by Neilius
TripleM wrote:Those are considered different, but your second solution can't display 01, for example.

If both of them resulted in being able to display all of the squares, then that would be two solutions.
Thanks :)

One more hypothetical question:

I have an array containing the squares: 01, 04, 09, etc.
If I mischeivously swapped the digits on all the numbers in that array (10, 40, 90, 61, etc) should I expect the same number of distinct solutions to come out of my algorithm?
I thought this might be a way to test if my algorithm had flaws.

Re: Problem 090

Posted: Tue Jan 24, 2017 4:24 am
by srinathmkce
TripleM wrote: Mon Aug 24, 2015 5:54 am Those are considered different, but your second solution can't display 01, for example, so that's only one solution.

If both of them resulted in being able to display all of the squares, then that would be two solutions.
I have a doubt here. Why 01 cant be formed with this combination .

{ 1, 3, 4, 5, 8, 9 } { 0, 1, 2, 6, 7, 9 }

0 in the second cube and 1 in the first cube

The same approach i see in problem statement as well.
For example, one way this can be achieved is by placing {0, 5, 6, 7, 8, 9} on one cube and {1, 2, 3, 4, 8, 9} on the other cube.
Am i missing something ?

Consider we are able to form all the squares with these two combinations

(1) { 0, 1, 2, 6, 7, 9 } { 1, 3, 4, 5, 8, 9 }
(2) { 1, 3, 4, 5, 8, 9 } { 0, 1, 2, 6, 7, 9 }

the 2nd one is not the duplicate ? I guess earlier post in the forum says its duplicate.

Re: Problem 090

Posted: Tue Jan 24, 2017 12:17 pm
by dawghaus4
srinathmkce wrote: Tue Jan 24, 2017 4:24 am
...

Am i missing something ?

Consider we are able to form all the squares with these two combinations

(1) { 0, 1, 2, 6, 7, 9 } { 1, 3, 4, 5, 8, 9 }
(2) { 1, 3, 4, 5, 8, 9 } { 0, 1, 2, 6, 7, 9 }

the 2nd one is not the duplicate ? I guess earlier post in the forum says its duplicate.
If you consider there to be a left cube and a right cube, then you have two distinct combinations but the second one can't produce 01. If either cube can be left and either cube can be right, then your second arrangement is a duplicate of the first.

Tom

Re: Problem 090

Posted: Tue Jan 24, 2017 12:43 pm
by Animus
srinathmkce wrote: Tue Jan 24, 2017 4:24 am Consider we are able to form all the squares with these two combinations

(1) { 0, 1, 2, 6, 7, 9 } { 1, 3, 4, 5, 8, 9 }
(2) { 1, 3, 4, 5, 8, 9 } { 0, 1, 2, 6, 7, 9 }

the 2nd one is not the duplicate ? I guess earlier post in the forum says its duplicate.
You are right, they are considered as duplicates.

Some of the comments above are a little misleading. You can't reach all squares with the same sequence of the two cubes, so the first and the second have to be interchangeable.

Re: Problem 090

Posted: Sun Apr 23, 2017 9:44 am
by itteerde
using plain brute force I do not see where I could have made an error other that in understanding the problem

Code: Select all

snip

Code: Select all

a:[5, 4, 3, 2, 1, 0], b:[9, 8, 3, 2, 1, 0]: 1
a:[5, 4, 3, 2, 1, 0], b:[9, 8, 4, 2, 1, 0]: 1
a:[5, 4, 3, 2, 1, 0], b:[9, 8, 4, 3, 2, 0]: 1
a:[5, 4, 3, 2, 1, 0], b:[9, 8, 4, 3, 2, 1]: 1
...
a:[9, 8, 7, 6, 5, 0], b:[9, 4, 3, 2, 1, 0]: 1
a:[9, 8, 7, 6, 5, 0], b:[9, 5, 4, 3, 2, 1]: 1
a:[9, 8, 7, 6, 5, 0], b:[9, 6, 4, 3, 2, 1]: 1
a:[9, 8, 7, 6, 5, 0], b:[9, 7, 4, 3, 2, 1]: 1
a:[9, 8, 7, 6, 5, 0], b:[9, 8, 4, 3, 2, 1]: 1