mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2017-05-30, 22:53   #34
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

16F816 Posts
Default

What are people's records? I found a solution for n=100. Who can beat that?
henryzz is offline   Reply With Quote
Old 2017-05-31, 14:03   #35
uau
 
Jan 2017

32×11 Posts
Default

Quote:
Originally Posted by henryzz View Post
What are people's records? I found a solution for n=100. Who can beat that?
There's a simple pattern that gives a simple solution for any number of pairs.
uau is offline   Reply With Quote
Old 2017-05-31, 14:08   #36
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

838410 Posts
Default

Quote:
Originally Posted by uau View Post
There's a simple pattern that gives a simple solution for any number of pairs.
yeah how I originally came up with my solution was pairing based on parity
all odd numbers can nest within other odd numbers all evens can nest within all even numbers. this doesn't give the minimum technically but it allows a way to figure a solution.
science_man_88 is offline   Reply With Quote
Old 2017-06-05, 21:35   #37
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

22·7·53 Posts
Default

It was a quite popular problem, the official solution is at: https://www.research.ibm.com/haifa/p...s/May2017.html

My very first try was an integer program using GLPK, unfortunately the n=26 case seems unreachable, there are too many integer variables. Only solvable the smaller cases, it can solve in 13 seconds the puzzle for n=10. (change line number 3 in the code to set n).

ps.
In the output we print 1 for 'A', 2 for 'B' etc. and 0 for hyphen. Note also that if there is a solution with length 2*n then there is a solution for (2*n+1), just add a hyphen to the end. That is why it is enough to search a solution for length=2*n+1 in the code.
Attached Files
File Type: txt letters.txt (1.1 KB, 103 views)
R. Gerbicz is offline   Reply With Quote
Old 2017-06-05, 21:44   #38
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

Quote:
Originally Posted by R. Gerbicz View Post
It was a quite popular problem, the official solution is at: https://www.research.ibm.com/haifa/p...s/May2017.html

My very first try was an integer program using GLPK, unfortunately the n=26 case seems unreachable, there are too many integer variables. Only solvable the smaller cases, it can solve in 13 seconds the puzzle for n=10. (change line number 3 in the code to set n).

ps.
In the output we print 1 for 'A', 2 for 'B' etc. and 0 for hyphen. Note also that if there is a solution with length 2*n then there is a solution for (2*n+1), just add a hyphen to the end. That is why it is enough to search a solution for length=2*n+1 in the code.
I used most that the method they describe and originally submitted the 55 character concatenation but something they missed is that both those solutions are reversible and they still work so in theory each solution is 2. edit: in fact had I not messed up and fixed my error and submitted the correction as a string earlier I might have been first to get that solution set if it was with my original solution submit it would have also been first on the list.

Last fiddled with by science_man_88 on 2017-06-05 at 22:01
science_man_88 is offline   Reply With Quote
Old 2017-06-06, 00:13   #39
uau
 
Jan 2017

32×11 Posts
Default

Attached is a program for searching solutions that's somewhat better than needed just to solve the original problem. It's a rather straightforward brute-force search that should find (barring bugs) every solution in alphabetical order. It can find hundreds of thousands of solutions per second, so by default it only prints every 1048576th solution found. You can control this with the first argument, which controls the power of 2 by which to reduce solutions (to specifying 0 means print every solution, the default corresponds to 20). A second argument defines a different starting point for the search; so if you start with the arguments "0 CAPACIOUS-NETFLIX" the first line of output is the alphabetically first solution starting with the given prefix. If you change the N #define and recompile you can check solutions for other lengths.

Number of possible solutions for low values of N for which it didn't take very long to generate the full list of solutions:
1: 1
2: 2
3: 6
4: 10
5: 22
6: 76
7: 364
8: 1876
9: 8316
10: 46768
11: 320208
12: 2127544
13: 13974760
14: 107492000
15: 959931648

Some possible prefixes a solution can start with that I generated from a word list (not that related to the original problem but some are kind of funny):
length 17:
CAPACIOUS-NETFLIX
CATACLYSM-JUKEBOX
COUNCIL-APARTHEID
GOURMET-GIVEAWAYS
UNHOLIEST-GHERKIN
length 16:
ORIZABA-BUMPIEST
ADAPTED-LIFEWORK
ATAVISM-UNDERBID
BURBLES-GIVEAWAY
CATACLYSM-INDORE
CATACLYSM-ZHUKOV
CATACLYSM-DEVOID
CATACLYSM-HEROIN
CATACLYSM-JERKIN
CATACOMBS-BENDIX
CATACOMBS-BERLIN
CYNIC-AMATEURISH
ESQUIRE-HYPNOTIC
EXPLORE-VANADIUM
NEOPHYTES-URCHIN
SHORTEN-UPHEAVAL
Attached Files
File Type: txt ponderthis_201705.c.txt (3.3 KB, 92 views)
uau is offline   Reply With Quote
Old 2017-06-06, 00:19   #40
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by uau View Post
Attached is a program for searching solutions that's somewhat better than needed just to solve the original problem. It's a rather straightforward brute-force search that should find (barring bugs) every solution in alphabetical order. It can find hundreds of thousands of solutions per second, so by default it only prints every 1048576th solution found. You can control this with the first argument, which controls the power of 2 by which to reduce solutions (to specifying 0 means print every solution, the default corresponds to 20). A second argument defines a different starting point for the search; so if you start with the arguments "0 CAPACIOUS-NETFLIX" the first line of output is the alphabetically first solution starting with the given prefix. If you change the N #define and recompile you can check solutions for other lengths.

Number of possible solutions for low values of N for which it didn't take very long to generate the full list of solutions:
1: 1
2: 2
3: 6
4: 10
5: 22
6: 76
7: 364
8: 1876
9: 8316
10: 46768
11: 320208
12: 2127544
13: 13974760
14: 107492000
15: 959931648

Some possible prefixes a solution can start with that I generated from a word list (not that related to the original problem but some are kind of funny):
length 17:
CAPACIOUS-NETFLIX
CATACLYSM-JUKEBOX
COUNCIL-APARTHEID
GOURMET-GIVEAWAYS
UNHOLIEST-GHERKIN
length 16:
ORIZABA-BUMPIEST
ADAPTED-LIFEWORK
ATAVISM-UNDERBID
BURBLES-GIVEAWAY
CATACLYSM-INDORE
CATACLYSM-ZHUKOV
CATACLYSM-DEVOID
CATACLYSM-HEROIN
CATACLYSM-JERKIN
CATACOMBS-BENDIX
CATACOMBS-BERLIN
CYNIC-AMATEURISH
ESQUIRE-HYPNOTIC
EXPLORE-VANADIUM
NEOPHYTES-URCHIN
SHORTEN-UPHEAVAL
You literally need only counting skills, and parity argument skills, to solve the given problem for the month. Had I not made my mistake I would have had a proper solution sent off to them within 30 minutes of this thread starting using notepad as a scratchpad and checking length with PARI/GP then fixing my error when they told me I made one.

Last fiddled with by science_man_88 on 2017-06-06 at 00:20
science_man_88 is offline   Reply With Quote
Old 2017-06-06, 00:46   #41
uau
 
Jan 2017

32×11 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
You literally need only counting skills, and parity argument skills, to solve the given problem for the month. Had I not made my mistake I would have had a proper solution sent off to them within 30 minutes of this thread starting using notepad as a scratchpad and checking length with PARI/GP then fixing my error when they told me I made one.
If you mean that it's possible to manually generate a single solution, I don't think you even need any "parity argument skills" to do that (you don't need to show that the '-' must be in an odd position to find a solution). Anyway I did myself find a pattern to generate one solution for any N as mentioned earlier in the thread. But I don't think finding a single possible solution exhausts all possible interest in the problem. You can ask further questions like "how common are the solutions" (as shown by the search, quite common).
uau is offline   Reply With Quote
Old 2017-06-06, 00:54   #42
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by uau View Post
If you mean that it's possible to manually generate a single solution, I don't think you even need any "parity argument skills" to do that (you don't need to show that the '-' must be in an odd position to find a solution). Anyway I did myself find a pattern to generate one solution for any N as mentioned earlier in the thread. But I don't think finding a single possible solution exhausts all possible interest in the problem. You can ask further questions like "how common are the solutions" (as shown by the search, quite common).
yeah the parity argument I used is the one talked about on the solution page given that odd spaced characters create a string of odd length so they fill the odd gap between another odd spaced one that's how to get the 55 length to start analysis from in the elegant solution talked about then you find you have to shorten it by replacing 2 of the hyphens you would have to get it to 53 or less. and then of course so is it's reverse because the distances between characters doesn't change on reversal cutting the needed strings to check in half.

Last fiddled with by science_man_88 on 2017-06-06 at 01:08
science_man_88 is offline   Reply With Quote
Old 2017-06-06, 02:23   #43
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by a1call View Post
Perhaps someone can do the number of atoms comparison here.
without caring for the multiplicity of any one character there are less than 10^76 strings. with restrictions that falls of course. with two the same character you can select them both at once and multiply by 26^51 to get 27*26^51 < 4*10^73 and that's without the spacing requirement there are 53*52 ways to place the first pair randomly and only 53*(53-(gap+2)) ways after the spacing requirement is in place for each pair (without account of overlap) for a character that has 2 so valid ways to place the A's are 53*(53-3) = 53*50 so 53^26*(51*26-(sum of gaps=13*27 = 270+81 =351)) = less than 7*10^47 once you account for overlap that will likely fall quite a bit and we know that unless there's symmetric solutions that the amount of solutions would be even. https://en.wikipedia.org/wiki/Shannon_number shows that the estimated number of atoms in the universe of normal matter exceeds the number of strings without restrictions. edit:okay I may have messed up the formulas a big bit on the larger side of things. there are only 51 ways to place to the first a after that there are two places where the start of the b's can't go without overlap in the placements left etc.

Last fiddled with by science_man_88 on 2017-06-06 at 02:45
science_man_88 is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
October 2017 Xyzzy Puzzles 9 2017-11-07 15:18
August 2017 Batalov Puzzles 15 2017-09-05 03:47
July 2017 R. Gerbicz Puzzles 6 2017-08-08 22:58
June 2017 R. Gerbicz Puzzles 14 2017-07-03 20:01
2017 LaurV Lounge 17 2017-01-01 15:22

All times are UTC. The time now is 03:51.


Sat Jul 17 03:51:03 UTC 2021 up 50 days, 1:38, 1 user, load averages: 1.92, 1.84, 1.71

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.