How to get $6$ from the numbers $\{6, 7, 8, 9\}$ using only addition, subtraction, division, and multiplication. Is there a way you can get the number $6$ from the numbers $6, 7, 8$, and $9$ using only addition, subtraction, multiplication, and division, without combining two numbers e.g. using the $6$ and $7$ to create $67$. You may use parentheses and you can have to use each of the $4$ numbers once.
 A: The following disgraceful python code performs an exhaustive search and gives no solutions for 6. Thw closest hit is $6+7/(8*9)\approx 6.097222$ (or $6-7/(8*9)$). You can change line 29, if K==6: from 6 to any other number to find other solutions. For instance, it finds correctly that $6/(7-9)+8=5$ and $(6+8)/(9-7)=7$. You can also remove the last 3 lines to make it spit out all possible answers. For instance, I believe all solutions for 7 are (with some dupes)
(6+8)/(9-7)=7.0                                                                                                                                 
(8+6)/(9-7)=7.0                                                                                                                                 
9-(6+8)/7=7.0                                                                                                                                   
9-((6+8)/7)=7.0                                                                                                                                 
9-(8+6)/7=7.0                                                                                                                                   
9-((8+6)/7)=7.0  

I didn't bother with checking if two choices of bracketing resulted in the same expression. In particular, it checks $4!\times 4^3\times 11=16896$ expressions(if the code doesnt terminate first). I hard-coded all possible bracketings because I don't know yet how to code better, but these are all of them because of How many ways are there to put parentheses between $n$ numbers? . It seems like I can learn from this website which solves a very similar problem. Anyway, the code-
import itertools

numbers = "6789"
functions = "+-*/"

b = "("
B = ")"
found_six_flag = False
for n in itertools.permutations(numbers):
    for f in itertools.product(functions,repeat=3) :
        results = []
        results.append(n[0]+f[0]+n[1]+f[1]+n[2]+f[2]+n[3] )      #1 a+b+c+d

        results.append(b+n[0]+f[0]+n[1]+B+f[1]+n[2]+f[2]+n[3])   #2 (a+b)+c+d
        results.append(b+n[0]+f[0]+n[1]+f[1]+n[2]+B+f[2]+n[3])    #3 (a+b+c)+d
        results.append(n[0]+f[0]+b+n[1]+f[1]+n[2]+B+f[2]+n[3])    #4 a+(b+c)+d
        results.append(n[0]+f[0]+b+n[1]+f[1]+n[2]+f[2]+n[3]+B)    #5 a+(b+c+d)
        results.append(n[0]+f[0]+n[1]+f[1]+b+n[2]+f[2]+n[3]+B)    #6 a+b+(c+d)

        results.append(b+n[0]+f[0]+n[1]+B+f[1]+b+n[2]+f[2]+n[3]+B)    #7 (a+b)+(c+d)
        results.append(b+b+n[0]+f[0]+n[1]+B+f[1]+n[2]+B+f[2]+n[3])    #8 ((a+b)+c)+d
        results.append(b+n[0]+f[0]+b+n[1]+f[1]+n[2]+B+B+f[2]+n[3])    #9 (a+(b+c))+d

        results.append(n[0]+f[0]+b+b+n[1]+f[1]+n[2]+B+f[2]+n[3]+B)    #10 a+((b+c)+d)
        results.append(n[0]+f[0]+b+n[1]+f[1]+b+n[2]+f[2]+n[3]+B+B)    #11 a+(b+(c+d))

        for result in results:
            K=eval(result)
            if K==6:
                found_six_flag = True
                print(result+"="+str(K))
                break
        if found_six_flag:
            break

You can compile this code on this website.
A: Use  Polish notation. Four numbers, each used only once. Three operators (out of 4). The sequence order matters.  Operators can be repeated. That would be 20 groups of 3 operators (taken from 4, with possible repetitions), {+, -, ×}, {+, -, :}, {+, ×, :}, {-, ×, :},  {+, +, -} ,  {+, + ×} , {+, +, :}, {-, -, +},   {-, -, ×},  {-, -, :},  {×,  ×, +}, {×, ×,  -}, {×, ×,  :}, {:, :,  +},  {:,  :,   -}, {:, :,  ×},  {+, +,  +}, 
{-, -,  -}, {×, ×,  ×},  {:, :,   :}. Now, for each group there are at most 6 permutations of these operators  if they are distinct  (or less if some operators are repeated). The four numbers are distinct, so we have 24 permutations in each case. 
To be optimistic, you have at most 
24 × 20 × 6 = 2880 Polish sequences to check.
I will do the first one.
+++6789 = 30  (not a 6). Well, you have at most  2879  more to go (a bit less actually). Good luck.
Edit. Following the comments, this analysis is incomplete , but a systematic approach (for the purpose of implementing a search algorithm) is possible.  It won't be done here.
A: Below python code generates all possible positive integer combinations of these numbers together with all possible combinations of signs in all possible places with the help of the reverse polish notation. It is worth pointing out that we can't achieve certain negative results (e.g. $-30=-6-7-8-9$) as we cannot put minus at the beginning. However all possible combinations ($4! \cdot C_3 \cdot 4^3 = 24 \cdot 5 \cdot 256 = 7680$ to be exact) are checked quite quickly yielding $127$ positive integer solutions none of which are equal to $6$.
permutations = [[6,7,8,9],[6,7,9,8],[6,8,7,9],[6,8,9,7],[6,9,7,8],[6,9,8,7],
                [7,6,8,9],[7,6,9,8],[7,8,6,9],[7,8,9,6],[7,9,6,8],[7,9,8,6],
                [8,6,7,9],[8,6,9,7],[8,7,6,9],[8,7,9,6],[8,9,6,7],[8,9,7,6],
                [9,6,7,8],[9,6,8,7],[9,7,6,8],[9,7,8,6],[9,8,6,7],[9,8,7,6]]
rpn = [[4,5,6],[3,5,6],[3,4,6],[2,5,6],[2,4,6]]
signs = [lambda x, y: x + y, lambda x, y: x - y, lambda x, y: x * y, lambda x, y: x / y]

stack = []
results = set()
for i in permutations:
    for j in rpn:
        for a in signs:
            for b in signs:
                for c in signs:
                    per = i.copy()
                    per.insert(j[0], a)
                    per.insert(j[1], b)
                    per.insert(j[2], c)
                    for k in per:
                        if(type(k) == int):
                            stack.append(k)
                        else:
                            p, q = stack.pop(), stack.pop()
                            stack.append(k(p,q))
                    results.add(stack.pop())

results = sorted(results)
for i in results:
    if(i == int(i) and i > 0):
        print(int(i))

