Problem 059

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.
TripleM
Posts: 382
Joined: Fri Sep 12, 2008 3:31 am

Re: Problem 059

Post by TripleM »

Exactly.

Loers
Posts: 10
Joined: Sun Aug 19, 2012 3:03 am

Re: Problem 059

Post by Loers »

aha thanks ,,

Flood
Posts: 7
Joined: Wed May 15, 2013 4:53 pm

Re: Problem 059

Post by Flood »

Would someone mind to take a look at my code (Python)? I think I have a decent approach but when I execute it I get weird characters (like musical notes, something similar to a telephone...) in the console and even the format gets scrambled. The XOR example works fine and I've been tested some other cases... Thanks.

satyres
Posts: 31
Joined: Thu Feb 20, 2014 2:48 pm

Re: Problem 059

Post by satyres »

Hi, i have a little problem with this one ,i missunderstand the problem because english is not my mother tongue ! so if anyone would explain where is the password to encrypt the text !
Thanks very much for your help

User avatar
stijn263
Posts: 1505
Joined: Sat Sep 15, 2007 11:57 pm
Location: Netherlands

Re: Problem 059

Post by stijn263 »

Guessing the password is part of the problem. It consists of three lower case characters for example abc, xyz, hex, qwe, etc

satyres
Posts: 31
Joined: Thu Feb 20, 2014 2:48 pm

Re: Problem 059

Post by satyres »

stijn263 wrote:Guessing the password is part of the problem. It consists of three lower case characters for example abc, xyz, hex, qwe, etc
Just a question : the password is in the text file ?

User avatar
stijn263
Posts: 1505
Joined: Sat Sep 15, 2007 11:57 pm
Location: Netherlands

Re: Problem 059

Post by stijn263 »

No it's not.
There's a single password, that you can use to decrypt the text file (using the procedure described in the problem text, the bitwise xor), that will result in a valid english text.
Solving this problem is about finding the password.

satyres
Posts: 31
Joined: Thu Feb 20, 2014 2:48 pm

Re: Problem 059

Post by satyres »

stijn263 wrote:No it's not.
There's a single password, that you can use to decrypt the text file (using the procedure described in the problem text, the bitwise xor), that will result in a valid english text.
Solving this problem is about finding the password.
Thanks for the help !
You said that we have to guess the password ! that's mean that there is not a way to find it ! just try each time a sequence of 3 alphabet ?
this is a little bit strange :?

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

Re: Problem 059

Post by hk »

Come to think of it:
How many three letter passwords are there?
Would it be too much of a trouble to go over them and find out which one converts the text into a valid English one?
You need only to find out a way to let your program decide if the converted text is a valid English one.
Image

satyres
Posts: 31
Joined: Thu Feb 20, 2014 2:48 pm

Re: Problem 059

Post by satyres »

hk wrote:Come to think of it:
How many three letter passwords are there?
Would it be too much of a trouble to go over them and find out which one converts the text into a valid English one?
You need only to find out a way to let your program decide if the converted text is a valid English one.
Thanks so much for the clarification !
last question please because english is not my mother tongue !
English valid text contain only Alphabet ,but there some special characters like ' and " - are there included too.
Thanks so much and sorry if i had bothered you with my question

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

Re: Problem 059

Post by hk »

A valid English text can also contain other characters than [a..z,A..Z], can't it?
Image

satyres
Posts: 31
Joined: Thu Feb 20, 2014 2:48 pm

Re: Problem 059

Post by satyres »

hk wrote:A valid English text can also contain other characters than [a..z,A..Z], can't it?
Please execuse multiple question but in english as i know we can write for example : I will = I'll ! or i"ll it's correct right ??

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

Re: Problem 059

Post by hk »

Forget for a moment that English.
Suppose the text should be in your mother tongue.
How would you proceed then?
Image

satyres
Posts: 31
Joined: Thu Feb 20, 2014 2:48 pm

Re: Problem 059

Post by satyres »

hk wrote:Forget for a moment that English.
Suppose the text should be in your mother tongue.
How would you proceed then?
sorry for being late to respond !
I think that i would seek for the alphabet in my mother tongue ! and then see if there any sepecial char otherwise it's wrong !

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

Re: Problem 059

Post by hk »

Is this really how you see with one eye if a text is in English or French?
According to you the text:
Kleiner Mann was machst du nun
is perfect French and English and Spanish as well as perfect Italian and perfect Portuguese, which isn't true true because it is German.
Image

User avatar
Marcus_Andrews
Administrator
Posts: 1473
Joined: Wed Nov 09, 2011 5:23 pm

Re: Problem 059

Post by Marcus_Andrews »

@satyres : As hk said, there aren't that many three-letter passwords. This means you could probably do something manually.
Image

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

Re: Problem 059

Post by dawghaus4 »

satyres,

It does not matter if the text contains special character ( '. ", /, 3, etc.) the same password would be used to encode and decode them.

As far as special characters in the password, the problem states "the encryption key consists of three lower case characters." In the English language, that is generally taken to be from the set {a, b, c, … z}. If the problem intended to allow other characters to be part of the encryption key, it should state that, or this thread would have lots of objections to the phrasing.

As suggested above, one might try all possible three-letter combinations - that will solve the problem - The question then becomes, "how to streamline the process?"

satyres
Posts: 31
Joined: Thu Feb 20, 2014 2:48 pm

Re: Problem 059

Post by satyres »

Thanks all for the help ! really appreciate ;
but there is a little missunderstood ! i know that the password containt only 3 alphabet ! the question is how to know that those 3 aplhabet are the good one to decode the text ! should i try every possiblity.
Thanks again and sorry for the missunderstood ! hope not bothering too much.

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

Re: Problem 059

Post by TripleM »

There are 26*26*26 possible passwords. As a human, if you tried a password, you would immediately be able to tell whether this was correct because the decoded text would become readable English, rather than jibberish.

The point of the program you have to write is to do this step automatically - determine whether a block of text makes sense in English, using your knowledge of how English works.

satyres
Posts: 31
Joined: Thu Feb 20, 2014 2:48 pm

Re: Problem 059

Post by satyres »

TripleM wrote:There are 26*26*26 possible passwords. As a human, if you tried a password, you would immediately be able to tell whether this was correct because the decoded text would become readable English, rather than jibberish.

The point of the program you have to write is to do this step automatically - determine whether a block of text makes sense in English, using your knowledge of how English works.
Thanks for the clarification i will do my best !

Post Reply