5
$\begingroup$

(This puzzle relies on familiarity with MathJax, the mathematics renderer that is automatically available for use in answers here at Puzzling Stack Exchange. Examples and more information can be found in related puzzles.)


          1 of these days I’m going to cut you into little pieces.
            – complete lyrics to “One of These Days” by Pink Floyd


Here goes MathJax, rendering 8 ones in two ways that use 8 instances of   1 ,   \1   or   #1 .

$\require{begingroup} \begingroup \small \def \L #1#2#3#4{ \kern9em\begin{array}{r}\kern -9em\texttt {#1}\\ \kern-3em \texttt {#2} \\[ -.4ex] \texttt {#3} \\[ -.3ex] \texttt{#4} \\[1.5ex] \hline \normalsize #2 #3 \end{array} } \L {\$\$\require{begingroup}\begingroup} {\def \1#1{#1#1}} {\1{\1{11}}} {\endgroup\$\$} {} \kern2em \L {\$\$\require{begingroup}\begingroup} {\def \1#1 {#1 #1 }} {\1\111 } {\endgroup\$\$} {} \endgroup$

And here we go, cutting that second way into 13 little pieces:


    $$\require{begingroup}\begingroup\def{}\endgroup$$

         11\1\1\1#1#1#1


Can you discard one   1 ,   \1   or   #1   and assemble the remaining 12 pieces to render $\raise.2ex\strut 11111111$ again?


A solution should directly render the result. Spaces and multiple lines are allowed. For a closely related puzzle, see MathJax looks kool. Your browser page might need to be reloaded in order to reset MathJax after errors while testing.

$\endgroup$
1
  • $\begingroup$ Not known at pose time: Can 9 ones ($\small 111111111$) or more be produced with such a collection of 12 pieces? $\endgroup$
    – humn
    Commented Sep 8, 2016 at 16:53

1 Answer 1

2
$\begingroup$

This appears to work:

$$\require{begingroup}\begingroup \def\1#1 {#1 #11 } \1\1 \endgroup$$

(I confess I got there by largely-undirected trial and error.)

Here:

$$\require{begingroup}\begingroup \def\1#1 {#1 #11 } \1\1 \endgroup$$

Trace:

$$\require{begingroup}\begingroup \def\Rest#1{{\small\texttt{#1}}} \def\This#1{{ \small\, \rlap{ \texttt {#1} } \raise-.2ex{ \underline{\hphantom{ \texttt{#1} }} } }} \def \Trace #1#2 #3#4 \end{ & \kern-1.04em \This{#1}\This{#2} \kern.22em \Rest{#4} \\ & & \kern-1.2em \begin{array}{lll} \llap{\color{gray}\hookrightarrow~} \This{#3} \Rest{#4} ~ = & \bf #3#4 \end{array} \end } % \def\1#1 { \Trace \1#1 {#1 #11 }} % \begin{array}{lll} & % \1\1 \end{array} \endgroup$$

$\endgroup$
6
  • $\begingroup$ Oh, yeah, I dropped a space when transcribing from the sandbox elsewhere I was playing in. Fixed now (and rendered demo included). $\endgroup$
    – Gareth McCaughan
    Commented Sep 9, 2016 at 23:39
  • $\begingroup$ Exce$11111111$ent! Sneaky hidden space at that. Mind if I append a live trace somewhat like the one at MathJax looks kool ? (Also hope you enjoyed the largely-undirected playtime, especially as it worked out.) $\endgroup$
    – humn
    Commented Sep 9, 2016 at 23:47
  • $\begingroup$ By all means append a live trace. Yeah, the fiddling around was pleasant enough. It didn't take all that long (I don't think the space of halfway plausible possibilities is very large). $\endgroup$
    – Gareth McCaughan
    Commented Sep 10, 2016 at 0:22
  • $\begingroup$ True, this puzzle is pretty much bite size. I'm fairly sure this is a local optimum in that 8 is the fewest 1s that can be produced with fewer "1" pieces and that more 1s cannot be produced with 7 "1" pieces. $\endgroup$
    – humn
    Commented Sep 10, 2016 at 0:29
  • $\begingroup$ Sounds plausible. Also, eight ones is indeed exactly byte-size. $\endgroup$
    – Gareth McCaughan
    Commented Sep 10, 2016 at 1:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.