Puzzling Stack Exchange is a question and answer site for those who create, solve, and study puzzles. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A mathematical expression is feasible, if it obeys the following rules:

  • Any real number may be used
  • One may use brackets "(" and ")" to structure the expression, and to make it well-defined
  • The allowed mathematical operations are addition ($+$), subtraction ($-$), multiplication ($*$).
  • Furthermore there is the special operation plus-minus ($\pm$).

Every feasible expression encodes the following set of numbers: every occurrence of $\pm$ in the expression is replaced once by $+$ and once by $-$, in all possible combinations.

Examples: For the expression $(1\pm2)\pm1$, we get the four corresponding numbers $(1+2)+1=4$ and $(1+2)-1=2$ and $(1-2)+1=0$ and $(1-2)-1=-2$; hence this expression encodes the set $\{-2,0,2,4\}$. Similarly one sees that the expression $(4\pm\frac12)\pm\frac12$ encodes the three-element set $\{3,4,5\}$.

Question: Does there exist a feasible expression that encodes the set $\{1,2,4\}$?

share|improve this question

Another, slightly more symmetrical option:

$(1.5 \pm 0.5) * (1.5 \pm 0.5)$

Explanation:

$(1.5 \pm 0.5)$ is equal to 1 or 2. So we have 1*1, 1*2, 2*1, and 2*2.

share|improve this answer

A set containing any single value is obviously a feasible expression. Further, given any set S of numbers which can be encoded as a feasible expression E, and any number x, the expression $x+(\frac12±\frac12)((E)-x)$ will be a feasible expression containing all of the items in S, along with x, but nothing else. Thus, any set of real values may be encoded as a feasible expression. Because {1,2,4} is a set of real values, it may be encoded as a feasible expression using the above approach, e.g.

Start with first item: $1$

Add second: $2 + (\frac12±\frac12)(1-2)$, i.e. $1\frac12±\frac12$

Add third: $4+(\frac12±\frac12)((1\frac12±\frac12)-4)$, i.e. $4+(\frac12±\frac12)(-2\frac12±\frac12)$

That approach will not necessarily yield the most compact expression for any given set of numbers, but it will find an expression meeting the criteria.

share|improve this answer
    
That is quite beautiful. – Scott M 12 hours ago
    
“[…] any set of real values may be encoded as a feasible expression” There is a “finite” missing somewhere in there. I’m pretty sure you can’t find an expression for R \ Q or even N. – Édouard 12 hours ago
    
@Édouard If feasible expressions must be finite (not specified), then you are correct. However, if infinitely long expressions are allowed, then I believe that one could use this method to generate any countable set of real numbers. In all cases though, I believe you are right as far as uncountable sets go. – Scott M 12 hours ago

We can use:

$1 + \underbrace{(\frac12\pm\frac12)}_{\text{$0$ or $1$}}*\underbrace{(2\pm1)}_{\text{$1$ or $3$}}$
Which gives us the corresponding numbers $1 + 0*1$, $1 + 0*3$, $1 + 1*1$ and $1 + 1*3$
And hence it encodes the three-element set $\{1, 2, 4\}$

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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