Author Topic: Interesting Problem  (Read 9612 times)

0 Members and 1 Guest are viewing this topic.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Interesting Problem
« on: December 06, 2005, 11:48:31 am »
In keeping with the theme of newspaper problems, somebody should write a program that solved the "cryptoquotes" found in the newspaper.  That is, sentences that have every instance of each letter replaced with another letter


HARRY LONGFELLOW
ABCCD EFGHIJKKFL


Although it is possible to do a full bruteforce, there are 26! combinations, which is an unfeasible number. 

Some things to reduce that might be to target 1-, then 2-, 3-, 4-, etc. letter words.  Also, to look for the most common letter, for pairs of letters that frequently occur, etc.

Also note that the quotes almost always contain proper names and other words you won't find in the dictionary, so the program would have to cope with that. 

Offline Chavo

  • x86
  • Hero Member
  • *****
  • Posts: 2219
  • no u
    • View Profile
    • Chavoland
Re: Interesting Problem
« Reply #1 on: December 06, 2005, 12:06:26 pm »
I can't imagine something like this not already existing.  Or is this a forum challenge thingy.....?

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Interesting Problem
« Reply #2 on: December 06, 2005, 12:17:06 pm »
Proper names that could be guessed by someone would be in an encyclopedia. I'm sure there's one online somewhere. Hint, hint.
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Interesting Problem
« Reply #3 on: December 06, 2005, 12:31:25 pm »
I can't imagine something like this not already existing.  Or is this a forum challenge thingy.....?

I'm sure it's been done before.  But it still posts an interesting challenge. 

It's not a forum challenge (although I had considered that :)), it's just a general challenge.  If somebody is trying to think of something to implement, and they want to solve a difficult problem, this is a good one. 

The main trick is that you can't solve it the simplest possible way.  It would take 26! = 4.03291461 × 1026 guesses, and that's not realistic.  So some kind of heuristical algorithm needs to be used to reduce that substantially, before it can be solved. 

It would just be neat to implement, and I doubt that any two people would implement it the same.  That's the best kind of problem :)

Offline mynameistmp

  • Full Member
  • ***
  • Posts: 111
  • Hi! I'm new here!
    • View Profile
Re: Interesting Problem
« Reply #4 on: December 07, 2005, 04:29:52 am »
Quote
That is, sentences that have every instance of each letter replaced with another letter

How long are the 'sentences' ?

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Interesting Problem
« Reply #5 on: December 07, 2005, 01:27:07 pm »
In the paper, they're usually about 3 or 4 lines, probably 5 or 6 words per line, so probably between 15 and 24 words. 

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: Interesting Problem
« Reply #6 on: December 07, 2005, 08:47:21 pm »
Really?  The last one I saw was about 8 words, ~6 letters each.  Maybe it was just a hard one?

Offline deadly7

  • 42
  • x86
  • Hero Member
  • *****
  • Posts: 6496
    • View Profile
Re: Interesting Problem
« Reply #7 on: December 07, 2005, 08:51:03 pm »
Wouldn't it actually be 10^25, because ROT encoding to the 26th power just means going back to where you came from..That's like ROT-26 encoding "A", it would get you "A"
[17:42:21.609] <Ergot> Kutsuju you're girlfrieds pussy must be a 403 error for you
 [17:42:25.585] <Ergot> FORBIDDEN

on IRC playing T&T++
<iago> He is unarmed
<Hitmen> he has no arms?!

on AIM with a drunk mythix:
(00:50:05) Mythix: Deadly
(00:50:11) Mythix: I'm going to fuck that red dot out of your head.
(00:50:15) Mythix: with my nine

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Interesting Problem
« Reply #8 on: December 07, 2005, 09:36:32 pm »
Each letter can be 25 others. 

A => B, C, D, E, F, G, ..............
B => A, C, D, E, F, G, ..............
etc.

Based on that, I think it would be like 2625 or something.  It's probably more complicated than that, because once A has a value, B has one less value to choose from.  So that would make it 26!....

Either way, it's an impossible number to bruteforce.

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: Interesting Problem
« Reply #9 on: December 07, 2005, 09:49:03 pm »
It's an entirely possible number to bruteforce, it would just take a very ... long time.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Interesting Problem
« Reply #10 on: December 07, 2005, 10:16:47 pm »
Well, everything is possible to bruteforce, but it's rather infeasible. 

It'd be interesting to find a GOOD solution to this :P

Offline Chavo

  • x86
  • Hero Member
  • *****
  • Posts: 2219
  • no u
    • View Profile
    • Chavoland
Re: Interesting Problem
« Reply #11 on: December 08, 2005, 01:13:54 am »
It'd be interesting to find a GOOD solution to this :P

How about waiting till the next day when they publish the answer?  :P

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Interesting Problem
« Reply #12 on: December 08, 2005, 01:29:03 am »
How about waiting till the next day when they publish the answer?  :P

Pff, you're boring!

Kidding, but yeah.  Maybe I'll try to think on this.  It is a pretty neat problem. :)

Offline zorm

  • Hero Member
  • *****
  • Posts: 591
    • View Profile
    • Zorm's Page
Re: Interesting Problem
« Reply #13 on: December 08, 2005, 03:18:46 pm »
We used to do these everyday in English class last year for fun. The method we used to solve them most often was looking at patterns in the letters of words. For example "people" is I believe the only word with a abxaxb pattern. My English teacher from last year knew a whole bunch of these and it helped lots. Once you get to this point you could likely just start filling in letters and trying to match them to actual words. You don't have to worry about names all that much because you can normally fill in all the other words and get the letters needed.

This seems like a lot of fun perhaps I'll start writing some code and see what I come up with.
"Frustra fit per plura quod potest fieri per pauciora"
- William of Ockham

Offline Nate

  • Full Member
  • ***
  • Posts: 425
  • You all suck
    • View Profile
Re: Interesting Problem
« Reply #14 on: December 08, 2005, 07:21:51 pm »
Maybe you guys should start with something easier like sudoku's then try this.

Also you want to treat this kinda like finding collisions, find all possbilities for each word, then compare the letter = letter values between words to find what works then out but all possible working combos
« Last Edit: December 08, 2005, 07:24:29 pm by Nate »