Problem 090

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
Forum rules
As your posts will be visible to the general public you
are requested to be thoughtful in not posting anything
that might explicitly give away how to solve a particular problem.

This forum is NOT meant to discuss solution methods for a problem.

In particular don't post any code fragments or results.

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
JiminP
Posts: 14
Joined: Sun Nov 06, 2011 3:07 am
Location: Seoul, South Korea

Re: Problem 090

Post by JiminP » Wed Jul 04, 2012 8:06 pm

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).
Image

TripleM
Posts: 382
Joined: Fri Sep 12, 2008 2:31 am

Re: Problem 090

Post by TripleM » Wed Jul 04, 2012 9:15 pm

{1,2,3,4,5,6} + {0,1,2,3,7,8} is a valid set.
How do you form 49 with these dice?

JiminP
Posts: 14
Joined: Sun Nov 06, 2011 3:07 am
Location: Seoul, South Korea

Re: Problem 090

Post by JiminP » Thu Jul 05, 2012 11:44 am

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
Image

PrimeRing
Posts: 5
Joined: Wed Jul 25, 2012 12:24 am

Re: Problem 090

Post by PrimeRing » Tue Oct 16, 2012 7:36 pm

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...

User avatar
hk
Administrator
Posts: 10482
Joined: Sun Mar 26, 2006 9:34 am
Location: Haren, Netherlands

Re: Problem 090

Post by hk » Tue Oct 16, 2012 7:54 pm

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.
Image

User avatar
euler
Administrator
Posts: 3113
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

Re: Problem 090

Post by euler » Wed Oct 17, 2012 6:26 am

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"?
Image
impudens simia et macrologus profundus fabulae

matmsh
Posts: 2
Joined: Sat Jan 12, 2013 8:03 pm

Problem 090

Post by matmsh » Sat Jan 12, 2013 8:11 pm

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

matmsh
Posts: 2
Joined: Sat Jan 12, 2013 8:03 pm

Re: Problem 90 Cube digit pairs

Post by matmsh » Sat Jan 12, 2013 8:22 pm

Sorry ! I just found out there is already a thread on this under "Problem 090".

User avatar
hk
Administrator
Posts: 10482
Joined: Sun Mar 26, 2006 9:34 am
Location: Haren, Netherlands

Re: Problem 090

Post by hk » Sat Jan 12, 2013 8:33 pm

Fixed
Image

wh97341375
Posts: 1
Joined: Wed Jan 16, 2013 12:16 pm

Re: Problem 090

Post by wh97341375 » Wed Jan 16, 2013 12:23 pm

COme on. buddy. all of you are excellent.

User avatar
Yamaneko
Posts: 6
Joined: Wed Nov 14, 2012 9:54 pm
Location: Budapest, Hungary

Re: Problem 090

Post by Yamaneko » Thu Jul 18, 2013 6:29 pm

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:
Image

thundre
Posts: 356
Joined: Sun Mar 27, 2011 9:01 am

Re: Problem 090

Post by thundre » Thu Jul 18, 2013 6:37 pm

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.
Image

User avatar
Yamaneko
Posts: 6
Joined: Wed Nov 14, 2012 9:54 pm
Location: Budapest, Hungary

Re: Problem 090

Post by Yamaneko » Fri Jul 19, 2013 12:51 pm

Ah, I get it now! Thanks, that cleared it up nicely! :D
Image

Neilius
Posts: 8
Joined: Mon Aug 24, 2015 4:27 am
Contact:

Re: Problem 090

Post by Neilius » Mon Aug 24, 2015 4:31 am

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?
Image

TripleM
Posts: 382
Joined: Fri Sep 12, 2008 2:31 am

Re: Problem 090

Post by TripleM » Mon Aug 24, 2015 4: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.

Neilius
Posts: 8
Joined: Mon Aug 24, 2015 4:27 am
Contact:

Re: Problem 090

Post by Neilius » Mon Aug 24, 2015 4:59 am

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.
Image

srinathmkce
Posts: 5
Joined: Fri Jun 19, 2015 1:50 pm

Re: Problem 090

Post by srinathmkce » Tue Jan 24, 2017 4:24 am

TripleM wrote:
Mon Aug 24, 2015 4: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.

User avatar
dawghaus4
Posts: 54
Joined: Fri Nov 29, 2013 2:22 am

Re: Problem 090

Post by dawghaus4 » Tue Jan 24, 2017 12:17 pm

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

User avatar
Animus
Administrator
Posts: 1701
Joined: Sat Aug 16, 2014 12:23 pm

Re: Problem 090

Post by Animus » Tue Jan 24, 2017 12:43 pm

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.

itteerde
Posts: 8
Joined: Wed Dec 31, 2014 6:59 am

Re: Problem 090

Post by itteerde » Sun Apr 23, 2017 8:44 am

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
Last edited by itteerde on Sun Apr 23, 2017 7:36 pm, edited 1 time in total.

Post Reply