![]() |
|
|
#34 |
|
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
23×3×5×72 Posts |
What are people's records? I found a solution for n=100. Who can beat that?
|
|
|
|
|
|
#35 |
|
Jan 2017
32×11 Posts |
|
|
|
|
|
|
#36 | |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
Quote:
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. |
|
|
|
|
|
|
#37 |
|
"Robert Gerbicz"
Oct 2005
Hungary
22×7×53 Posts |
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. |
|
|
|
|
|
#38 | |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
Quote:
Last fiddled with by science_man_88 on 2017-06-05 at 22:01 |
|
|
|
|
|
|
#39 |
|
Jan 2017
32×11 Posts |
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 |
|
|
|
|
|
#40 | |
|
"Forget I exist"
Jul 2009
Dumbassville
20C016 Posts |
Quote:
Last fiddled with by science_man_88 on 2017-06-06 at 00:20 |
|
|
|
|
|
|
#41 | |
|
Jan 2017
32×11 Posts |
Quote:
|
|
|
|
|
|
|
#42 | |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
Quote:
Last fiddled with by science_man_88 on 2017-06-06 at 01:08 |
|
|
|
|
|
|
#43 |
|
"Forget I exist"
Jul 2009
Dumbassville
203008 Posts |
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 |
|
|
|
![]() |
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 |