Problem 118

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.
estanford
Posts: 10
Joined: Sun Sep 13, 2009 12:06 pm

Problem 118

Post by estanford »

Problem 118 asks about distinct sets containing each of the digits one through nine exactly once. Are we free to assume that the sets contain only those digits, or might they include the digit zero?
ThomasH
Posts: 117
Joined: Sun Mar 26, 2006 8:41 am
Location: Berlin, Germany

Re: Problem 118

Post by ThomasH »

estanford wrote: ... or might they include the digit zero?
Definitively not.
estanford
Posts: 10
Joined: Sun Sep 13, 2009 12:06 pm

Re: Problem 118

Post by estanford »

Got it. I just reread the problem statement and noticed that the possibility was excluded by the set construction rule.
User avatar
Francky
Posts: 90
Joined: Sat May 07, 2011 3:49 pm
Location: South of France

Re: Problem 118

Post by Francky »

I'm proud of my algo
2.9s of uncompiled Python. (No extern help like prime file...)
ImageEntia non sunt multiplicanda praeter necessitatem
spacetweek
Posts: 3
Joined: Wed Oct 12, 2011 11:15 am

Re: Problem 118

Post by spacetweek »

Is there a minimum number of elements that the set has to contain?
User avatar
Francky
Posts: 90
Joined: Sat May 07, 2011 3:49 pm
Location: South of France

Re: Problem 118

Post by Francky »

spacetweek wrote:Is there a minimum number of elements that the set has to contain?
A set with one single element could be valid.
ImageEntia non sunt multiplicanda praeter necessitatem
eagle33199
Posts: 1
Joined: Sun Aug 12, 2012 7:00 am

Re: Problem 118

Post by eagle33199 »

*edit*

Never mind, I just found my issue. I reduced my search space to only include the numbers 1-4 (only 9 results), which made it small enough to figure out by hand which items I was missing, and then track down why.
User avatar
thedoctar
Posts: 128
Joined: Fri Apr 15, 2011 11:57 am
Location: Sydney, Australia

Re: Problem 118

Post by thedoctar »

OH MY GOD!!!! It has taken me an hour to realise that {1, 2} is not distinct from {2, 1}. I'm so used to the problem giving examples and defining distinctness. Might I ask for examples of distinct sets and indistinct sets to be given so that others won't fall into the same mistake as mine?
Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
Image
fabas indulcet fames
User avatar
euler
Administrator
Posts: 5095
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

Re: Problem 118

Post by euler »

A set is described by the unique unordered elements it contains. So, for example, the sets {1,4,9}, {1,4,1,9,1}, and {9,1,4} are identical as the order of the elements is irrelevant and each set essentially contains the elements 1, 4, and 9. Certainly for comparison it is helpful to list elements in some logical order, but it is not necessary. Remember elements of a set do not need to be numbers and can be data/objects of any type, which can make ordering in some cases subjective.

I don't think it is practical to define every standard mathematical term we use. However, I would say that we do need to define terms when there is any possibility of ambiguity, or when we wish to take liberties with the accepted understanding of the mathematical terms.

If you can find a recognised source which says that in some cases {1,2} and {2,1} are considered distinct or if others feel that there is sufficient cause for confusion in this particular problem then I will gladly modify the problem wording. But we must be careful not to open the floodgates of adding pages of footnotes to every problem.
Image
impudens simia et macrologus profundus fabulae
User avatar
thedoctar
Posts: 128
Joined: Fri Apr 15, 2011 11:57 am
Location: Sydney, Australia

Re: Problem 118

Post by thedoctar »

euler wrote: If you can find a recognised source which says that in some cases {1,2} and {2,1} are considered distinct or if others feel that there is sufficient cause for confusion in this particular problem then I will gladly modify the problem wording. But we must be careful not to open the floodgates of adding pages of footnotes to every problem.
Yes I understand this, I rushed through reading the problem and as I said, previous problems have given examples of distinctness and I was so accustomed to this that I totally ignored the fact that sets had to be distinct and it took me so long to find this mistake.

I don't want to be any trouble, but maybe problems where little details like only counting distinct sets could be bolded, which won't add any text to the problem but will prevent people reading over those details?
Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
Image
fabas indulcet fames
thundre
Posts: 356
Joined: Sun Mar 27, 2011 10:01 am

Re: Problem 118

Post by thundre »

I don't think there is any ambiguity here. "Set" is a well-defined mathematical term. The word "distinct" appears in the problem statement even though it is unneccessary. For someone to think they had to count all permutations of each set seems like a rare misinterpretation.
Image
User avatar
thedoctar
Posts: 128
Joined: Fri Apr 15, 2011 11:57 am
Location: Sydney, Australia

Re: Problem 118

Post by thedoctar »

Okay, well if it's just me and my strange interpretation you don't have to change anything, I just didn't read question properly I guess.
Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
Image
fabas indulcet fames
pimspelier
Posts: 41
Joined: Tue Jan 21, 2014 2:06 pm
Location: The Netherlands

Re: Problem 118

Post by pimspelier »

I've got a question. After looking at my Python code for some time, I have removed some bugs, but still get the red cross :(. Can I PM someone with my code, since I have no idea what I might be doing wrong. I count each set only once, so that's not the problem.
Image
Arthelais
Posts: 3
Joined: Wed Oct 08, 2014 2:57 pm

Re: Problem 118

Post by Arthelais »

pimspelier wrote:I've got a question. After looking at my Python code for some time, I have removed some bugs, but still get the red cross :(. Can I PM someone with my code, since I have no idea what I might be doing wrong. I count each set only once, so that's not the problem.
Send it through!
User avatar
solarmew
Posts: 42
Joined: Thu Jan 01, 2015 3:52 pm

Re: Problem 118

Post by solarmew »

could i also please have someone look at my code? >.> ... i've double checked it several times, i feel like it should work %\
Image
366541_5799d51e95657e1a227f2cb86bd181de
Bubbler
Posts: 28
Joined: Sat Feb 23, 2013 6:12 am

Re: Problem 118

Post by Bubbler »

What language are you using?
Image
User avatar
solarmew
Posts: 42
Joined: Thu Jan 01, 2015 3:52 pm

Re: Problem 118

Post by solarmew »

nm, found the problem +.+
Image
366541_5799d51e95657e1a227f2cb86bd181de
Chimerade
Posts: 31
Joined: Sun Mar 26, 2006 10:18 am
Location: France

Re: Problem 118

Post by Chimerade »

Hi,

Is 1 considered as prime in problem 118 ?

Thank You
LilStalker
Posts: 74
Joined: Thu Nov 03, 2016 4:32 pm

Re: Problem 118

Post by LilStalker »

1 will never be considered a prime number since it is not a prime number.
Image
Chimerade
Posts: 31
Joined: Sun Mar 26, 2006 10:18 am
Location: France

Re: Problem 118

Post by Chimerade »

Thank You !

I was not up to date on this question... You are right ! Thank you for a very quick answer
Post Reply